aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/posix/patch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index b10b40c2..23fe83a0 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -7,7 +7,6 @@
*
* TODO:
* -b backup
- * -l treat all whitespace as a single space
* -N ignore already applied
* -d chdir first
* -D define wrap #ifdef and #ifndef around changes
@@ -143,7 +142,7 @@ static int apply_one_hunk(void)
else trailing = 0;
if (toys.optflags & FLAG_x) fprintf(stderr, "HUNK:%s\n", plist->data);
}
- matcheof = trailing < TT.context;
+ matcheof = !trailing || trailing < TT.context;
if (toys.optflags & FLAG_x)
fprintf(stderr,"MATCHEOF=%c\n", matcheof ? 'Y' : 'N');