summaryrefslogtreecommitdiffstats
path: root/package/config/menu.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-02-02 14:59:18 +0100
committerPeter Korsgaard <jacmet@sunsite.dk>2011-02-02 15:54:50 +0100
commita72ab0542ff1dd8909ba5f1065627e41e3316b45 (patch)
tree0b6fe75709ffe7dbf821ed2b7ac038f8cd49510c /package/config/menu.c
parenta538d4057e3add76889270ec097572223b11ba07 (diff)
downloadbuildroot-novena-a72ab0542ff1dd8909ba5f1065627e41e3316b45.tar.gz
buildroot-novena-a72ab0542ff1dd8909ba5f1065627e41e3316b45.zip
package/config: rebase against 2.6.38-rc3
Fixes nconfig crash on comments within choice groups. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/config/menu.c')
-rw-r--r--package/config/menu.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/package/config/menu.c b/package/config/menu.c
index 1deca3c92..d49f8b8ff 100644
--- a/package/config/menu.c
+++ b/package/config/menu.c
@@ -203,7 +203,7 @@ void menu_add_option(int token, char *arg)
}
}
-static int menu_range_valid_sym(struct symbol *sym, struct symbol *sym2)
+static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
{
return sym2->type == S_INT || sym2->type == S_HEX ||
(sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
@@ -221,6 +221,15 @@ static void sym_check_prop(struct symbol *sym)
prop_warn(prop,
"default for config symbol '%s'"
" must be a single symbol", sym->name);
+ if (prop->expr->type != E_SYMBOL)
+ break;
+ sym2 = prop_get_symbol(prop);
+ if (sym->type == S_HEX || sym->type == S_INT) {
+ if (!menu_validate_number(sym, sym2))
+ prop_warn(prop,
+ "'%s': number is invalid",
+ sym->name);
+ }
break;
case P_SELECT:
sym2 = prop_get_symbol(prop);
@@ -240,8 +249,8 @@ static void sym_check_prop(struct symbol *sym)
if (sym->type != S_INT && sym->type != S_HEX)
prop_warn(prop, "range is only allowed "
"for int or hex symbols");
- if (!menu_range_valid_sym(sym, prop->expr->left.sym) ||
- !menu_range_valid_sym(sym, prop->expr->right.sym))
+ if (!menu_validate_number(sym, prop->expr->left.sym) ||
+ !menu_validate_number(sym, prop->expr->right.sym))
prop_warn(prop, "range is invalid");
break;
default: