summaryrefslogtreecommitdiff
path: root/scripts/config/conf.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-08-03 19:47:34 +0200
committerFelix Fietkau <nbd@nbd.name>2016-08-03 20:03:35 +0200
commit2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5 (patch)
tree43bc0a7953f008fad5fbc793e8d2dfca2e540081 /scripts/config/conf.c
parent7bf3695b0230d4cc4b6348f7c87b3c164314db8d (diff)
downloadmtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.zip
mtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.gz
mtk-20170518-2d7e602381f3c473d6c8214e8e56bcf80ccf9fa5.tar.bz2
scripts/config: sync with latest linux upstream
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/config/conf.c')
-rw-r--r--scripts/config/conf.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/scripts/config/conf.c b/scripts/config/conf.c
index 16e5c43..6d35957 100644
--- a/scripts/config/conf.c
+++ b/scripts/config/conf.c
@@ -5,6 +5,7 @@
#include <locale.h>
#include <ctype.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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] <kconfig-file>\n", progname);
+ printf("Usage: %s [-s] [option] <kconfig-file>\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;