You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when I apply the same decode command twice, it will firstly decode correctly and the second time generate an error and overwrites the target file with an empty file.
My suggestion would be to avoid writing an empty file if an error occurs or to detect that the diff has already been applied and simply do nothing. Currently, it is dangerous to accidentally apply a decode twice but I'm not sure if this is intended behavior or a bug.
How to reproduce
Give the two files modified and original.
Encode step:
vcdiff encode -dictionary modified -target original -delta patch
vcdiff encode -dictionary original -target modified -delta undo
Now we have a patch and an undo file for applying the patch and undo'ing it.
fc original original_decoded
Comparing files original and ORIGINAL_DECODED
FC: no differences encountered
fc modified modified_decoded
Comparing files modified and MODIFIED_DECODED
FC: no differences encountered
All good.
The "bug" (?):
vcdiff decode -dictionary modified_decoded -target modified_decoded -delta patch
vcdiff decode -dictionary modified_decoded -target modified_decoded -delta patch
ERROR: Source segment length (528920) is larger than dictionary (51502)
Error trying to decode data chunk of length 50912
Now modified_decoded has 0 KB.
The text was updated successfully, but these errors were encountered:
I noticed that when I apply the same
decode
command twice, it will firstly decode correctly and the second time generate an error and overwrites the target file with an empty file.My suggestion would be to avoid writing an empty file if an error occurs or to detect that the diff has already been applied and simply do nothing. Currently, it is dangerous to accidentally apply a decode twice but I'm not sure if this is intended behavior or a bug.
How to reproduce
Give the two files
modified
andoriginal
.Encode step:
Now we have a
patch
and anundo
file for applying the patch and undo'ing it.Decode step:
Verification step:
All good.
The "bug" (?):
Now
modified_decoded
has0 KB
.The text was updated successfully, but these errors were encountered: