-
Notifications
You must be signed in to change notification settings - Fork 510
applyPatch affecting wrong line number with with new lines #159
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
Comments
UPDATE: I've narrowed the scope of the bug down to when context is set to 0. So by setting it to 1 or higher it works correctly:
|
Good catch. Same happens here. |
Also having problems with empty lines in 3 cases.
is not applied (and following blocks are applied in the wrong place as line numbers don't match anymore)
Pull request #212 fixes those cases (as far as I can test, comparing on a limited number of real-life samples with the behaviour of the linux patch command, which I would consider a good reference) |
I think this got fixed with #212 |
@kpdecker your library is great so far. I think I might have found an edge case unless i'm missing something?
Now I create a patch
This patch/diff looks correct
However when I apply the patch....
We can see it seems to be affecting the wrong line number. Is it trimming somewhere on the oldString where it shouldn't be?
The text was updated successfully, but these errors were encountered: