← 返回首页
fix: parsing unified diff chunk headers by rushiiMachine · Pull Request #198 · java-diff-utils/java-diff-utils · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

fix: parsing unified diff chunk headers#198

Merged
wumpz merged 1 commit into
java-diff-utils:masterfrom
Aliucord:fix/unified-chunk-headers
Feb 5, 2025
Merged

fix: parsing unified diff chunk headers#198
wumpz merged 1 commit into
java-diff-utils:masterfrom
Aliucord:fix/unified-chunk-headers

Conversation

Copy link
Copy Markdown
Contributor

The regex matching chunk headers does not account for unified diffs generated with --show-function-line (with GNU diffutils for example)

Currently this library parses only the following chunk header: @@ -571,6 +571,12 @@
But this is also valid: @@ -571,6 +571,12 @@ .method public constructor <init>(Landro

This also created a very odd error far down the call stack of this method call when old_ln and new_ln are both equal to 0 as a result of failing to parse the chunk headers.

// Process the lines in the last chunk
processLinesInPrevChunk(rawChunk, patch, old_ln, new_ln);

The regex matching chunk headers does not account for diffs generated with --show-function-line
wumpz merged commit 8397e20 into java-diff-utils:master Feb 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Footer

© 2026 GitHub, Inc.