summaryrefslogtreecommitdiff
path: root/package/config
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-09-29 20:21:38 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-09-29 20:21:38 +0000
commite6382c49a46a36e2e1241d9a33a9f5f246a57e19 (patch)
tree083201c86eeda607f9f5866b2701b542a4875aca /package/config
parentc9073264657b866ce6d1ad8430a3a22d61b493dd (diff)
- pull "kconfig: oldconfig shall not set symbols if it does not need to"
Diffstat (limited to 'package/config')
-rw-r--r--package/config/conf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/package/config/conf.c b/package/config/conf.c
index 841635ea9..bd2ca4bb6 100644
--- a/package/config/conf.c
+++ b/package/config/conf.c
@@ -64,7 +64,7 @@ static void check_stdin(void)
}
}
-static void conf_askvalue(struct symbol *sym, const char *def)
+static int conf_askvalue(struct symbol *sym, const char *def)
{
enum symbol_type type = sym_get_type(sym);
tristate val;
@@ -79,7 +79,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
printf("%s\n", def);
line[0] = '\n';
line[1] = 0;
- return;
+ return 0;
}
switch (input_mode) {
@@ -89,23 +89,23 @@ static void conf_askvalue(struct symbol *sym, const char *def)
case set_random:
if (sym_has_value(sym)) {
printf("%s\n", def);
- return;
+ return 0;
}
break;
case ask_new:
case ask_silent:
if (sym_has_value(sym)) {
printf("%s\n", def);
- return;
+ return 0;
}
check_stdin();
case ask_all:
fflush(stdout);
fgets(line, 128, stdin);
- return;
+ return 1;
case set_default:
printf("%s\n", def);
- return;
+ return 1;
default:
break;
}
@@ -115,7 +115,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
case S_HEX:
case S_STRING:
printf("%s\n", def);
- return;
+ return 1;
default:
;
}
@@ -166,6 +166,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
break;
}
printf("%s", line);
+ return 1;
}
int conf_string(struct menu *menu)
@@ -179,7 +180,8 @@ int conf_string(struct menu *menu)
def = sym_get_string_value(sym);
if (sym_get_string_value(sym))
printf("[%s] ", def);
- conf_askvalue(sym, def);
+ if (!conf_askvalue(sym, def))
+ return 0;
switch (line[0]) {
case '\n':
break;
@@ -236,7 +238,8 @@ static int conf_sym(struct menu *menu)
if (sym->help)
printf("/?");
printf("] ");
- conf_askvalue(sym, sym_get_string_value(sym));
+ if (!conf_askvalue(sym, sym_get_string_value(sym)))
+ return 0;
strip(line);
switch (line[0]) {