From 2fe69382d37bf75ecf4ef4d730339c4982a82461 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 1 Nov 2015 05:43:03 -0600 Subject: Last patch broke creating new file as a patch, fix it. (Matches beginning and EOF at once.) --- toys/posix/patch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toys/posix/patch.c') 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'); -- cgit v1.2.3