kconfig: warn about leading whitespace for menu prompts
Kconfig does its own indentation of menu prompts, so warn about and ignore leading whitespace. Remove also a few unnecessary newlines after other warning prints. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
b65a47e1ac
commit
f001f7f896
1 changed files with 10 additions and 6 deletions
|
@ -114,7 +114,7 @@ void menu_set_type(int type)
|
||||||
sym->type = type;
|
sym->type = type;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'\n",
|
menu_warn(current_entry, "type of '%s' redefined from '%s' to '%s'",
|
||||||
sym->name ? sym->name : "<choice>",
|
sym->name ? sym->name : "<choice>",
|
||||||
sym_type_name(sym->type), sym_type_name(type));
|
sym_type_name(sym->type), sym_type_name(type));
|
||||||
}
|
}
|
||||||
|
@ -124,15 +124,20 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
|
||||||
struct property *prop = prop_alloc(type, current_entry->sym);
|
struct property *prop = prop_alloc(type, current_entry->sym);
|
||||||
|
|
||||||
prop->menu = current_entry;
|
prop->menu = current_entry;
|
||||||
prop->text = prompt;
|
|
||||||
prop->expr = expr;
|
prop->expr = expr;
|
||||||
prop->visible.expr = menu_check_dep(dep);
|
prop->visible.expr = menu_check_dep(dep);
|
||||||
|
|
||||||
if (prompt) {
|
if (prompt) {
|
||||||
|
if (isspace(*prompt)) {
|
||||||
|
prop_warn(prop, "leading whitespace ignored");
|
||||||
|
while (isspace(*prompt))
|
||||||
|
prompt++;
|
||||||
|
}
|
||||||
if (current_entry->prompt)
|
if (current_entry->prompt)
|
||||||
menu_warn(current_entry, "prompt redefined\n");
|
prop_warn(prop, "prompt redefined");
|
||||||
current_entry->prompt = prop;
|
current_entry->prompt = prop;
|
||||||
}
|
}
|
||||||
|
prop->text = prompt;
|
||||||
|
|
||||||
return prop;
|
return prop;
|
||||||
}
|
}
|
||||||
|
@ -343,11 +348,10 @@ void menu_finalize(struct menu *parent)
|
||||||
|
|
||||||
if (sym && !(sym->flags & SYMBOL_WARNED)) {
|
if (sym && !(sym->flags & SYMBOL_WARNED)) {
|
||||||
if (sym->type == S_UNKNOWN)
|
if (sym->type == S_UNKNOWN)
|
||||||
menu_warn(parent, "config symbol defined "
|
menu_warn(parent, "config symbol defined without type");
|
||||||
"without type\n");
|
|
||||||
|
|
||||||
if (sym_is_choice(sym) && !parent->prompt)
|
if (sym_is_choice(sym) && !parent->prompt)
|
||||||
menu_warn(parent, "choice must have a prompt\n");
|
menu_warn(parent, "choice must have a prompt");
|
||||||
|
|
||||||
/* Check properties connected to this symbol */
|
/* Check properties connected to this symbol */
|
||||||
sym_check_prop(sym);
|
sym_check_prop(sym);
|
||||||
|
|
Loading…
Add table
Reference in a new issue