From 2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 3 Aug 2016 19:47:34 +0200 Subject: scripts/config: sync with latest linux upstream Signed-off-by: Felix Fietkau --- scripts/config/conf.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'scripts/config/conf.c') diff --git a/scripts/config/conf.c b/scripts/config/conf.c index 16e5c43787..6d35957afe 100644 --- a/scripts/config/conf.c +++ b/scripts/config/conf.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -41,7 +42,7 @@ static int tty_stdio; static int valid_stdin = 1; static int sync_kconfig; static int conf_cnt; -static char line[128]; +static char line[PATH_MAX]; static struct menu *rootEntry; static void print_help(struct menu *menu) @@ -109,7 +110,7 @@ static int conf_askvalue(struct symbol *sym, const char *def) /* fall through */ case oldaskconfig: fflush(stdout); - xfgets(line, 128, stdin); + xfgets(line, sizeof(line), stdin); if (!tty_stdio) printf("\n"); return 1; @@ -311,7 +312,7 @@ static int conf_choice(struct menu *menu) /* fall through */ case oldaskconfig: fflush(stdout); - xfgets(line, 128, stdin); + xfgets(line, sizeof(line), stdin); strip(line); if (line[0] == '?') { print_help(menu); @@ -471,7 +472,7 @@ static struct option long_opts[] = { static void conf_usage(const char *progname) { - printf("Usage: %s [option] \n", progname); + printf("Usage: %s [-s] [option] \n", progname); printf("[option] is _one_ of the following:\n"); printf(" --listnewconfig List new options\n"); printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); @@ -502,7 +503,11 @@ int main(int ac, char **av) tty_stdio = isatty(0) && isatty(1) && isatty(2); - while ((opt = getopt_long(ac, av, "r:w:", long_opts, NULL)) != -1) { + while ((opt = getopt_long(ac, av, "r:w:s", long_opts, NULL)) != -1) { + if (opt == 's') { + conf_set_message_callback(NULL); + continue; + } switch (opt) { case silentoldconfig: sync_kconfig = 1; -- cgit v1.2.3