janjongboom/janpatch

patched file is not identical to the NEW

gymax opened this issue · 3 comments

gymax commented

Thanks for upload this project. However the patch is not work in some cases.
For example, create below these files in "integration-tests/source".

  1. dd if=/dev/zeros of=zero.bin bs=1 count=2048
  2. dd if=/dev/zero bs=1 count=2048 | tr "\000" "\377" > FF.bin

run "node integration-tests/run-tests.js" and found mismatch result.

Generating diffs...
Generated /home/vtdev/test/janpatch/integration-tests/target/FF_zero.diff

Patching...

    ✗ FF_zero Hash mismatch (expected: e5a00aa9991ac8a5ee3109844d84a55583bd20572ad3ffcd42792f3c36b183ad, but was 5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef) (4 ms.)

Summary: 0/1 succeeded (total time: 4 ms.)

The original jptch is ok to patch these cases.

gymax commented

I found this issue is related to the buffers in ctx.
Set 4096 instead of 1024... patched ok.
Set 128... patched NG.
Same result when I patch a 300kB file.

@gymax, thanks, I'll take a look today at what might be the issue.

Thanks, I fixed this in #10.