From: Alan Cox Date: Sun, 7 Dec 2014 14:29:24 +0000 (+0000) Subject: ssh: fflush the shell prompt X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=2f5ac730c99207d8c8c0604a0201d8d8aea30a33;p=FUZIX.git ssh: fflush the shell prompt From: Will Sowerbutts The assumption that libc will fflush stdout on an fgets of stdin is not anything the standards guarantee. Do the needed fflush --- diff --git a/Applications/util/ssh.c b/Applications/util/ssh.c index 6399ac7f..aad10086 100644 --- a/Applications/util/ssh.c +++ b/Applications/util/ssh.c @@ -51,6 +51,7 @@ main(int argc, char *argval[]) for (i = 0; i < MAX_ARGS; i++) arg[i][0] = (char) 0; do { printf("ssh%c ", cprompt); + fflush(stdout); fgets(buf, 127, stdin); if (feof(stdin)) return 0; /* user typed ^D ? */ buf[strlen(buf) - 1] = '\0'; /* Strip newline from fgets */