diff options
-rw-r--r-- | kconfig/Makefile.am | 6 | ||||
-rw-r--r-- | kconfig/conf.c | 12 | ||||
-rw-r--r-- | kconfig/expr.c | 7 | ||||
-rw-r--r-- | kconfig/parser.y | 1 |
4 files changed, 21 insertions, 5 deletions
diff --git a/kconfig/Makefile.am b/kconfig/Makefile.am index 2db26155..a6d47fce 100644 --- a/kconfig/Makefile.am +++ b/kconfig/Makefile.am @@ -17,14 +17,14 @@ AM_YFLAGS = -t -l AM_CPPFLAGS = -include config.h -DCONFIG_=\"CT_\" AM_LIBTOOLFLAGS = --tag CC -conf_SOURCES = conf.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c +conf_SOURCES = conf.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c conf_LDADD = $(LIBINTL) -nconf_SOURCES = nconf.c nconf.gui.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c +nconf_SOURCES = nconf.c nconf.gui.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c nconf_CFLAGS = $(CURSES_CFLAGS) nconf_LDADD = $(MENU_LIBS) $(PANEL_LIBS) $(CURSES_LIBS) $(LIBINTL) -mconf_SOURCES = mconf.c confdata.c expr.c symbol.c preprocess.c lexer.lex.c parser.tab.c \ +mconf_SOURCES = mconf.c confdata.c expr.c symbol.c preprocess.c util.c lexer.lex.c parser.tab.c \ lxdialog/checklist.c lxdialog/inputbox.c \ lxdialog/menubox.c lxdialog/textbox.c lxdialog/util.c \ lxdialog/yesno.c diff --git a/kconfig/conf.c b/kconfig/conf.c index dd714b48..393e96e4 100644 --- a/kconfig/conf.c +++ b/kconfig/conf.c @@ -32,6 +32,7 @@ enum input_mode { defconfig, savedefconfig, listnewconfig, + helpnewconfig, olddefconfig, }; static enum input_mode input_mode = oldaskconfig; @@ -434,6 +435,11 @@ static void check_conf(struct menu *menu) printf("%s%s=%s\n", CONFIG_, sym->name, str); } } + } else if (input_mode == helpnewconfig) { + printf("-----\n"); + print_help(menu); + printf("-----\n"); + } else { if (!conf_cnt++) printf("*\n* Restart config...\n*\n"); @@ -459,6 +465,7 @@ static struct option long_opts[] = { {"alldefconfig", no_argument, NULL, alldefconfig}, {"randconfig", no_argument, NULL, randconfig}, {"listnewconfig", no_argument, NULL, listnewconfig}, + {"helpnewconfig", no_argument, NULL, helpnewconfig}, {"olddefconfig", no_argument, NULL, olddefconfig}, {NULL, 0, NULL, 0} }; @@ -523,6 +530,7 @@ int main(int ac, char **av) case allmodconfig: case alldefconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: break; case '?': @@ -556,6 +564,7 @@ int main(int ac, char **av) case oldaskconfig: case oldconfig: case listnewconfig: + case helpnewconfig: case olddefconfig: conf_read(NULL); break; @@ -637,6 +646,7 @@ int main(int ac, char **av) /* fall through */ case oldconfig: case listnewconfig: + case helpnewconfig: case syncconfig: /* Update until a loop caused no more changes */ do { @@ -655,7 +665,7 @@ int main(int ac, char **av) defconfig_file); return 1; } - } else if (input_mode != listnewconfig) { + } else if (input_mode != listnewconfig && input_mode != helpnewconfig) { if (!no_conf_write && conf_write(NULL)) { fprintf(stderr, "\n*** Error during writing of the configuration.\n\n"); exit(1); diff --git a/kconfig/expr.c b/kconfig/expr.c index 77ffff3a..9f1de58e 100644 --- a/kconfig/expr.c +++ b/kconfig/expr.c @@ -254,6 +254,13 @@ static int expr_eq(struct expr *e1, struct expr *e2) { int res, old_count; + /* + * A NULL expr is taken to be yes, but there's also a different way to + * represent yes. expr_is_yes() checks for either representation. + */ + if (!e1 || !e2) + return expr_is_yes(e1) && expr_is_yes(e2); + if (e1->type != e2->type) return 0; switch (e1->type) { diff --git a/kconfig/parser.y b/kconfig/parser.y index 60936c76..b3eff961 100644 --- a/kconfig/parser.y +++ b/kconfig/parser.y @@ -727,5 +727,4 @@ void zconfdump(FILE *out) } } -#include "util.c" #include "menu.c" |