summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjon <jon@FreeBSD.org>2001-08-05 08:39:58 +0000
committerjon <jon@FreeBSD.org>2001-08-05 08:39:58 +0000
commit306e18018e9e8ac86a95c5209d26007d6b69e956 (patch)
tree71cd96dc76318e290afe3623fe6ce9e3da76a576 /usr.bin
parent1f57f122959daa995b130f2ba0b9056fdd5e5a91 (diff)
downloadFreeBSD-src-306e18018e9e8ac86a95c5209d26007d6b69e956.zip
FreeBSD-src-306e18018e9e8ac86a95c5209d26007d6b69e956.tar.gz
Fix using /usr/bin/ftp as a slave process on the end of a pipe by calling
fflush(stdout). This is one ancient PR... PR: bin/1589 Submitted by: imp
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/main.c5
-rw-r--r--usr.bin/ftp/util.c1
2 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index dd1f210..0934765 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -375,10 +375,9 @@ cmdscanner(top)
#ifndef SMALL
if (!editing) {
#endif /* !SMALL */
- if (fromatty) {
+ if (fromatty)
fputs(prompt(), stdout);
- (void)fflush(stdout);
- }
+ (void)fflush(stdout);
if (fgets(line, sizeof(line), stdin) == NULL)
quit(0, 0);
num = strlen(line);
diff --git a/usr.bin/ftp/util.c b/usr.bin/ftp/util.c
index 3afd17b..86277aa 100644
--- a/usr.bin/ftp/util.c
+++ b/usr.bin/ftp/util.c
@@ -251,6 +251,7 @@ login(host, user, pass)
printf("Name (%s:%s): ", host, myname);
else
printf("Name (%s): ", host);
+ (void)fflush(stdout);
if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL)
return (0);
tmp[strlen(tmp) - 1] = '\0';
OpenPOWER on IntegriCloud