summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorJonathan Chen <jon@FreeBSD.org>2001-08-05 08:39:58 +0000
committerJonathan Chen <jon@FreeBSD.org>2001-08-05 08:39:58 +0000
commit48aa92042e43d7d1a1cafa66c29f4857d902bf71 (patch)
tree71cd96dc76318e290afe3623fe6ce9e3da76a576 /usr.bin/ftp
parent3d04a9d7e3349928688abc0e2d6d84fe5d149d2a (diff)
downloadsrc-test-48aa92042e43d7d1a1cafa66c29f4857d902bf71.tar.gz
src-test-48aa92042e43d7d1a1cafa66c29f4857d902bf71.zip
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
Notes
Notes: svn path=/head/; revision=81155
Diffstat (limited to 'usr.bin/ftp')
-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 dd1f210fa940f..09347657fc673 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 3afd17ba532cc..86277aafee38e 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';