mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-14 13:32:23 +00:00
patch+LibDiff: Implement 'strip' of filenames when parsing patch
Implement the patch '-p' / '--strip' option, which strips the given number of leading components from filenames parsed in the patch header. If not given this option defaults to the basename of that path.
This commit is contained in:
parent
87e2b8e343
commit
81df0278b1
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/shannonbooth
Commit: 81df0278b1
Pull-request: https://github.com/SerenityOS/serenity/pull/20007
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
4 changed files with 80 additions and 5 deletions
|
@ -82,9 +82,10 @@ public:
|
|||
|
||||
ErrorOr<Vector<Hunk>> parse_hunks();
|
||||
|
||||
ErrorOr<Header> parse_header();
|
||||
ErrorOr<Header> parse_header(Optional<size_t> const& strip_count);
|
||||
|
||||
private:
|
||||
ErrorOr<String> parse_file_line(Optional<size_t> const& strip_count);
|
||||
Optional<HunkLocation> consume_unified_location();
|
||||
bool consume_line_number(size_t& number);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue