diff options
author | Rob Landley <rob@landley.net> | 2009-03-29 01:08:34 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2009-03-29 01:08:34 -0500 |
commit | aa7f3faa2c42ab829c200cb8048a0fa8743c9290 (patch) | |
tree | ca9d78a0fa8d86caca388ea336a70c597e0a52c1 /toys | |
parent | 121582ee95f839c928e46e2f87660684d0dba207 (diff) | |
download | toybox-aa7f3faa2c42ab829c200cb8048a0fa8743c9290.tar.gz |
Another patch corner case.0.0.9.1
Diffstat (limited to 'toys')
-rw-r--r-- | toys/patch.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/toys/patch.c b/toys/patch.c index b44bca24..84e4d197 100644 --- a/toys/patch.c +++ b/toys/patch.c @@ -219,6 +219,13 @@ void patch_main(void) patchline = get_line(TT.filepatch); if (!patchline) break; + // Other versions of patch accept damaged patches, + // so we need to also. + if (!*patchline) { + free(patchline); + patchline = xstrdup(" "); + } + // Are we assembling a hunk? if (state >= 2) { if (*patchline==' ' || *patchline=='+' || *patchline=='-') { |