summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/patch/inp.c
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>1997-02-13 21:10:45 +0000
committerjmg <jmg@FreeBSD.org>1997-02-13 21:10:45 +0000
commitfddb79c0af0d4bf9176b52713c0df1c2bafe48e5 (patch)
tree3913a51d4c09be4a013b66307b63291d4e50768a /gnu/usr.bin/patch/inp.c
parent8f1bd632d4528e09dc9ca0ed45397ded3364d354 (diff)
downloadFreeBSD-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/inp.c')
-rw-r--r--gnu/usr.bin/patch/inp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gnu/usr.bin/patch/inp.c b/gnu/usr.bin/patch/inp.c
index e8e1531..7b78651 100644
--- a/gnu/usr.bin/patch/inp.c
+++ b/gnu/usr.bin/patch/inp.c
@@ -1,6 +1,9 @@
-/* $Header: /home/ncvs/src/gnu/usr.bin/patch/inp.c,v 1.2 1995/01/12 22:09:39 hsu Exp $
+/* $Header: /usr/cvs/src/gnu/usr.bin/patch/inp.c,v 1.3 1995/05/30 05:02:31 rgrimes Exp $
*
* $Log: inp.c,v $
+ * Revision 1.3 1995/05/30 05:02:31 rgrimes
+ * Remove trailing whitespace.
+ *
* Revision 1.2 1995/01/12 22:09:39 hsu
* Fix bug that created new files even when running in -C check mode.
* Reviewed by: phk
@@ -240,7 +243,7 @@ char *filename;
"this file doesn't appear to be the %s version--aborting.\n", revision);
}
else {
- ask2(
+ (void) ask2(
"This file doesn't appear to be the %s version--patch anyway? [n] ",
revision);
if (*buf != 'y')
@@ -289,7 +292,7 @@ char *filename;
"this file doesn't appear to be the %s version--aborting.\n", revision);
}
else {
- ask2(
+ (void) ask2(
"This file doesn't appear to be the %s version--patch anyway? [n] ",
revision);
if (*buf != 'y')
OpenPOWER on IntegriCloud