From aa7f3faa2c42ab829c200cb8048a0fa8743c9290 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 29 Mar 2009 01:08:34 -0500 Subject: Another patch corner case. --- toys/patch.c | 7 +++++++ 1 file changed, 7 insertions(+) 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=='-') { -- cgit v1.2.3