summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-02-19 02:24:26 +0200
committerMichal Marek <mmarek@suse.cz>2013-02-19 13:48:36 +0100
commit62dc989921df2a98d1a73aacd085abe941cb9828 (patch)
tree72702c0a12050ee4325f5cc8fe2a2ab8de60c362 /scripts
parent2c68115cb3d2863004f1dd5c01e3adbd54facd4c (diff)
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 <ben@decadent.org.uk> 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 <regid23@nt1.in> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/conf.c7
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 {
} input_mode = oldaskconfig;
static int indent = 1;
+static int tty_stdio;
static int valid_stdin = 1;
static int sync_kconfig;
static int conf_cnt;
@@ -108,6 +109,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;
@@ -495,6 +498,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) {
@@ -621,7 +626,7 @@ int main(int ac, char **av)
return 1;
}
}
- valid_stdin = isatty(0) && isatty(1) && isatty(2);
+ valid_stdin = tty_stdio;
}
switch (input_mode) {