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';