X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=config%2Fconfdata.c;h=695253e055cefc96b98f461fbf0ab1b4fc69860b;hp=24b7e4657b8de90e42d63c36a84ef6d1c790bdea;hb=7b1214ae732be753158ec3c004d232c3c2dfc592;hpb=fcd2962f05220e69124436a67cb9f93b46b6cf14 diff --git a/config/confdata.c b/config/confdata.c index 24b7e46..695253e 100644 --- a/config/confdata.c +++ b/config/confdata.c @@ -913,6 +913,7 @@ int conf_write(const char *name) const char *str; char tmpname[PATH_MAX + 1], oldname[PATH_MAX + 1]; char *env; + bool need_newline = false; if (!name) name = conf_get_configname(); @@ -958,12 +959,16 @@ int conf_write(const char *name) "#\n" "# %s\n" "#\n", str); + need_newline = false; } else if (!(sym->flags & SYMBOL_CHOICE)) { sym_calc_value(sym); if (!(sym->flags & SYMBOL_WRITE)) goto next; + if (need_newline) { + fprintf(out, "\n"); + need_newline = false; + } sym->flags &= ~SYMBOL_WRITE; - conf_write_symbol(out, sym, &kconfig_printer_cb, NULL); } @@ -975,6 +980,12 @@ next: if (menu->next) menu = menu->next; else while ((menu = menu->parent)) { + if (!menu->sym && menu_is_visible(menu) && + menu != &rootmenu) { + str = menu_get_prompt(menu); + fprintf(out, "# end of %s\n", str); + need_newline = true; + } if (menu->next) { menu = menu->next; break;