mkfs, fsck: Flush stdout when prompting for input
authorWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 22:11:20 +0000 (22:11 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sat, 14 Feb 2015 22:11:32 +0000 (22:11 +0000)
Applications/util/fsck.c
Applications/util/mkfs.c

index 6de8a1b..2e93d23 100644 (file)
@@ -713,6 +713,8 @@ int yes(void)
     char line[20];
     /*int  fgets(); -- HP */
 
+    fflush(stdout);
+
     if (!fgets(line, sizeof(line), stdin) || (*line != 'y' && *line != 'Y'))
        return (0);
 
index b0214f9..54e8013 100644 (file)
@@ -96,6 +96,8 @@ int yes(void)
 {
     char line[20];
 
+    fflush(stdout);
+
     if (!fgets(line, sizeof(line), stdin) || (*line != 'y' && *line != 'Y'))
        return (0);