]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: make --quiet really quiet
authorKarel Zak <kzak@redhat.com>
Mon, 1 Feb 2016 13:30:31 +0000 (14:30 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 1 Feb 2016 13:30:31 +0000 (14:30 +0100)
References: https://github.com/karelzak/util-linux/issues/268
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 8b213001bfeb06cc2a981de55b852c44db05ca90..4e99df53b88804a1be98c95b46de54e039581e2b 100644 (file)
@@ -1591,13 +1591,15 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
                        sf->prompt = xstrdup(SFDISK_PROMPT);
                }
 
+               if (sf->prompt && (sf->interactive || !sf->quiet)) {
 #ifndef HAVE_LIBREADLINE
-               if (sf->prompt)
                        fputs(sf->prompt, stdout);
 #else
-               if (!sf->interactive && sf->prompt)
-                       fputs(sf->prompt, stdout);
+                       if (!sf->interactive)
+                               fputs(sf->prompt, stdout);
 #endif
+               }
+
                rc = fdisk_script_read_line(dp, stdin, buf, sizeof(buf));
                if (rc < 0) {
                        DBG(PARSE, ul_debug("script parsing failed, trying sfdisk specific commands"));