diff options
author | jmg <jmg@FreeBSD.org> | 1997-02-13 21:10:45 +0000 |
---|---|---|
committer | jmg <jmg@FreeBSD.org> | 1997-02-13 21:10:45 +0000 |
commit | fddb79c0af0d4bf9176b52713c0df1c2bafe48e5 (patch) | |
tree | 3913a51d4c09be4a013b66307b63291d4e50768a /gnu/usr.bin/patch/pch.c | |
parent | 8f1bd632d4528e09dc9ca0ed45397ded3364d354 (diff) | |
download | FreeBSD-src-fddb79c0af0d4bf9176b52713c0df1c2bafe48e5.zip FreeBSD-src-fddb79c0af0d4bf9176b52713c0df1c2bafe48e5.tar.gz |
Fix a problem with patch in that is will always default, even when the
controlling terminal is closed. Now the function ask() will return 1 when th
input is known to come from a file or terminal, or it will return 0 when ther
was a read error.
Modified the question "Skip patch?" so that on an error from ask it will skip
the patch instead of looping.
Closes PR#777
2.2 candidate
Diffstat (limited to 'gnu/usr.bin/patch/pch.c')
-rw-r--r-- | gnu/usr.bin/patch/pch.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gnu/usr.bin/patch/pch.c b/gnu/usr.bin/patch/pch.c index eb0c54a..c976838 100644 --- a/gnu/usr.bin/patch/pch.c +++ b/gnu/usr.bin/patch/pch.c @@ -1,6 +1,10 @@ -/* $Header: /home/ncvs/src/gnu/usr.bin/patch/pch.c,v 1.7 1996/04/11 10:13:40 markm Exp $ +/* $Header: /usr/cvs/src/gnu/usr.bin/patch/pch.c,v 1.8 1996/04/12 11:37:32 markm Exp $ * * $Log: pch.c,v $ + * Revision 1.8 1996/04/12 11:37:32 markm + * Attempt to break a $Log$ snafu where a *** /--- (minus space) + * was fouling up a comment in the checked-out code. + * * Revision 1.7 1996/04/11 10:13:40 markm * Priorities were broken. If there was an Index: line and *** /--- lines * with valid names, the *** /---names were taken first. @@ -219,7 +223,7 @@ there_is_another_patch() skip_rest_of_patch = TRUE; return TRUE; } - ask1("File to patch: "); + (void) ask1("File to patch: "); if (*buf != '\n') { if (bestguess) free(bestguess); @@ -227,9 +231,10 @@ there_is_another_patch() filearg[0] = fetchname(buf, 0, FALSE); } if (filearg[0] == Nullch) { - ask1("No file found--skip this patch? [n] "); - if (*buf != 'y') { - continue; + if (ask1("No file found--skip this patch? [n] ")) { + if (*buf != 'y') { + continue; + } } if (verbose) say1("Skipping patch...\n"); |