From: Ben Hutchings Date: Tue, 19 Feb 2013 00:24:26 +0000 (+0200) Subject: kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new X-Git-Tag: 1.9.8~1 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=64463ab6b5921f840a8fe7ac9b48923c704c15b5;p=carl9170fw.git kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new According to Documentation/kbuild/kconfig.txt, the commands: yes "" | make oldconfig >conf.new grep "(NEW)" conf.new should list the new config symbols with their default values. However, currently there is no line break after each new symbol. When kconfig is interactive the user will type a new-line at this point, but when non-interactive kconfig must print it. Signed-off-by: Ben Hutchings Reference: http://bugs.debian.org/636029 [regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree] Reported-and-tested-by: Regid Ichira Reviewed-by: Jonathan Nieder Signed-off-by: Michal Marek Signed-off-by: Christian Lamparter --- diff --git a/config/conf.c b/config/conf.c index 649ea82..cdbdb11 100644 --- a/config/conf.c +++ b/config/conf.c @@ -35,6 +35,7 @@ enum input_mode { } input_mode = oldaskconfig; static int indent = 1; +static int tty_stdio; static int valid_stdin = 1; static int conf_cnt; static char line[128]; @@ -105,6 +106,8 @@ static int conf_askvalue(struct symbol *sym, const char *def) case oldaskconfig: fflush(stdout); xfgets(line, 128, stdin); + if (!tty_stdio) + printf("\n"); return 1; default: break; @@ -482,6 +485,8 @@ int main(int ac, char **av) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); + tty_stdio = isatty(0) && isatty(1) && isatty(2); + while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { input_mode = (enum input_mode)opt; switch (opt) { @@ -583,7 +588,7 @@ int main(int ac, char **av) break; } - valid_stdin = isatty(0) && isatty(1) && isatty(2); + valid_stdin = tty_stdio; switch (input_mode) { case allnoconfig: