twaugh / patchutils

Manipulate patch files
GNU General Public License v2.0
139 stars 22 forks source link

filterdiff: Display hunk comments containing NUL #11

Closed ColMelvin closed 8 years ago

ColMelvin commented 8 years ago

If the comment for a hunk contains an ASCII NUL, then no newline would be output before the first line of context (as the c-string 'ended' prematurely). This breaks the patch such that it cannot be applied, even with a fuzz factor. Handle this unorthodox case to better support binary files.

Included is a simplified test case showing the issue.

twaugh commented 8 years ago

Thank you!