From 48aa92042e43d7d1a1cafa66c29f4857d902bf71 Mon Sep 17 00:00:00 2001 From: Jonathan Chen Date: Sun, 5 Aug 2001 08:39:58 +0000 Subject: [PATCH] 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 --- usr.bin/ftp/main.c | 5 ++--- usr.bin/ftp/util.c | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index dd1f210fa940..09347657fc67 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 3afd17ba532c..86277aafee38 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';