kconfig: fix missing '# end of' for empty menu
Currently, "# end of ..." is inserted when the menu goes back to its parent. Hence, an empty menu: menu "Foo" endmenu ... ends up with unbalanced menu comments, like this: # # Foo # Let's close the menu comments properly: # # Foo # # end of Foo Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
868653f421
commit
a7d4f58e99
|
@ -903,19 +903,20 @@ next:
|
||||||
menu = menu->list;
|
menu = menu->list;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (menu->next)
|
|
||||||
menu = menu->next;
|
end_check:
|
||||||
else while ((menu = menu->parent)) {
|
if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu &&
|
||||||
if (!menu->sym && menu_is_visible(menu) &&
|
menu->prompt->type == P_MENU) {
|
||||||
menu != &rootmenu) {
|
fprintf(out, "# end of %s\n", menu_get_prompt(menu));
|
||||||
str = menu_get_prompt(menu);
|
|
||||||
fprintf(out, "# end of %s\n", str);
|
|
||||||
need_newline = true;
|
need_newline = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menu->next) {
|
if (menu->next) {
|
||||||
menu = menu->next;
|
menu = menu->next;
|
||||||
break;
|
} else {
|
||||||
}
|
menu = menu->parent;
|
||||||
|
if (menu)
|
||||||
|
goto end_check;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
|
Loading…
Reference in New Issue