1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

LibDiff: Make parsing of unified hunks more robust

Parsing of the unified hunks now verifies that the expected number of
lines given by the unified location at the beginning of that hunk are
actually in that hunk. Furthermore, we no longer crash when given a
bogus unified range.

As a further benefit, this begins the scaffolding for a patch parser
which should assist us in parsing full patches - even when we are not
aware of the format that a patch has been written in.
This commit is contained in:
Shannon Booth 2023-07-02 19:19:22 +12:00 committed by Sam Atkins
parent b2d33c5689
commit ef45221c21
3 changed files with 102 additions and 72 deletions

View file

@ -8,6 +8,8 @@
namespace Diff {
class Parser;
struct Hunk;
struct HunkLocation;
struct Line;