summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--disk-utils/sfdisk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index 8b213001b..4e99df53b 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -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"));