aboutsummaryrefslogtreecommitdiff
path: root/toys/patch.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2009-03-29 01:08:34 -0500
committerRob Landley <rob@landley.net>2009-03-29 01:08:34 -0500
commitaa7f3faa2c42ab829c200cb8048a0fa8743c9290 (patch)
treeca9d78a0fa8d86caca388ea336a70c597e0a52c1 /toys/patch.c
parent121582ee95f839c928e46e2f87660684d0dba207 (diff)
downloadtoybox-aa7f3faa2c42ab829c200cb8048a0fa8743c9290.tar.gz
Another patch corner case.0.0.9.1
Diffstat (limited to 'toys/patch.c')
-rw-r--r--toys/patch.c7
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=='-') {