summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/patch/util.c
diff options
context:
space:
mode:
authorJohn-Mark Gurney <jmg@FreeBSD.org>1997-02-13 21:10:45 +0000
committerJohn-Mark Gurney <jmg@FreeBSD.org>1997-02-13 21:10:45 +0000
commit53e3a4a22cdb458ffd1ccfb09c68ab248afb7e30 (patch)
tree3913a51d4c09be4a013b66307b63291d4e50768a /gnu/usr.bin/patch/util.c
parent39191c8eb86b3eef96a047a6b4a08cd472490d28 (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/patch/util.c')
-rw-r--r--gnu/usr.bin/patch/util.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gnu/usr.bin/patch/util.c b/gnu/usr.bin/patch/util.c
index 56ce12e1be90..6c00880c658b 100644
--- a/gnu/usr.bin/patch/util.c
+++ b/gnu/usr.bin/patch/util.c
@@ -227,7 +227,7 @@ long arg1,arg2,arg3;
/* Get a response from the user, somehow or other. */
-void
+int
ask(pat,arg1,arg2,arg3)
char *pat;
long arg1,arg2,arg3;
@@ -260,7 +260,9 @@ long arg1,arg2,arg3;
}
else { /* no terminal at all--default it */
buf[0] = '\n';
- r = 1;
+ buf[1] = 0;
+ say1(buf);
+ return 0; /* signal possible error */
}
if (r <= 0)
buf[0] = 0;
@@ -268,6 +270,11 @@ long arg1,arg2,arg3;
buf[r] = '\0';
if (!tty2)
say1(buf);
+
+ if (r <= 0)
+ return 0; /* if there was an error, return it */
+ else
+ return 1;
}
#endif /* lint */