Skip to content

Conversation

@zxxyye
Copy link

@zxxyye zxxyye commented Sep 6, 2023

When memcmp returns 0 and cmpsize < newsize, it means that old + I[x] is smaller than new, then search(..., x, en, pos) should be performed instead of search(..., st, x, pos)

…ing string to be missed

When memcmp returns 0 and cmpsize < newsize, it means that `old + I[x]` is smaller than `new`, then `search(..., x, en, pos)` should be performed instead of `search(..., st, x, pos)`
@zxxyye
Copy link
Author

zxxyye commented Sep 6, 2023

You can reproduce this bug by constructing the following two files:

  • old.txt: 20MB, all characters are '0' except the last two characters are '1' and '0'. It's something like this: "0000000...000010"

  • new.txt: 20MB, all characters are '0'

bsdiff old.txt new.txt patch.out will take very very long time

edcdecl added a commit to edcdecl/bsdiff that referenced this pull request Feb 20, 2024
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.

1 participant