Skip to content

Parsing of diffs on windows fails #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
crsdrw opened this issue Feb 10, 2019 · 0 comments
Closed

Parsing of diffs on windows fails #28

crsdrw opened this issue Feb 10, 2019 · 0 comments

Comments

@crsdrw
Copy link
Contributor

crsdrw commented Feb 10, 2019

Running the standard GNU diff tool on windows can produce diff output with CRLF line endings instead of LF line endings. This currently causes an error in this diff parser.

To reproduce, run the go-diff diagnostic tool on the attached diff:

go-diff -f sample_diff_win.txt

and get the following error:

err read file(0): line 3, char 116: bad hunk header: @@ -1,3 +1,9 @@

The parser uses an in-built line reader instead of bufio.Scanner which does not strip trailing CR characters from lines (unlike bufio.Scanner)

sample_diff_win.txt

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

No branches or pull requests

1 participant