diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/conf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4da3b4adfad2..e39fcd8143ea 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -36,6 +36,7 @@ enum input_mode { | |||
36 | } input_mode = oldaskconfig; | 36 | } input_mode = oldaskconfig; |
37 | 37 | ||
38 | static int indent = 1; | 38 | static int indent = 1; |
39 | static int tty_stdio; | ||
39 | static int valid_stdin = 1; | 40 | static int valid_stdin = 1; |
40 | static int sync_kconfig; | 41 | static int sync_kconfig; |
41 | static int conf_cnt; | 42 | static int conf_cnt; |
@@ -108,6 +109,8 @@ static int conf_askvalue(struct symbol *sym, const char *def) | |||
108 | case oldaskconfig: | 109 | case oldaskconfig: |
109 | fflush(stdout); | 110 | fflush(stdout); |
110 | xfgets(line, 128, stdin); | 111 | xfgets(line, 128, stdin); |
112 | if (!tty_stdio) | ||
113 | printf("\n"); | ||
111 | return 1; | 114 | return 1; |
112 | default: | 115 | default: |
113 | break; | 116 | break; |
@@ -495,6 +498,8 @@ int main(int ac, char **av) | |||
495 | bindtextdomain(PACKAGE, LOCALEDIR); | 498 | bindtextdomain(PACKAGE, LOCALEDIR); |
496 | textdomain(PACKAGE); | 499 | textdomain(PACKAGE); |
497 | 500 | ||
501 | tty_stdio = isatty(0) && isatty(1) && isatty(2); | ||
502 | |||
498 | while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { | 503 | while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { |
499 | input_mode = (enum input_mode)opt; | 504 | input_mode = (enum input_mode)opt; |
500 | switch (opt) { | 505 | switch (opt) { |
@@ -621,7 +626,7 @@ int main(int ac, char **av) | |||
621 | return 1; | 626 | return 1; |
622 | } | 627 | } |
623 | } | 628 | } |
624 | valid_stdin = isatty(0) && isatty(1) && isatty(2); | 629 | valid_stdin = tty_stdio; |
625 | } | 630 | } |
626 | 631 | ||
627 | switch (input_mode) { | 632 | switch (input_mode) { |