kconfig: show '?' prompt even if no help text is available
[carl9170fw.git] / config / conf.c
index 6be614318782bfc3c2e3525a8ebc5ad94d775f70..51a781ad06a8b7e612b7d10de0ea4f7d4d754c18 100644 (file)
@@ -20,7 +20,6 @@
 
 static void conf(struct menu *menu);
 static void check_conf(struct menu *menu);
-static void xfgets(char *str, int size, FILE *in);
 
 enum input_mode {
        oldaskconfig,
@@ -34,7 +33,8 @@ enum input_mode {
        savedefconfig,
        listnewconfig,
        oldnoconfig,
-} input_mode = oldaskconfig;
+};
+static enum input_mode input_mode = oldaskconfig;
 
 static int indent = 1;
 static int tty_stdio;
@@ -80,6 +80,13 @@ static void check_stdin(void)
        }
 }
 
+/* Helper function to facilitate fgets() by Jean Sacren. */
+static void xfgets(char *str, int size, FILE *in)
+{
+       if (!fgets(str, size, in))
+               fprintf(stderr, "\nError in reading or end of file.\n");
+}
+
 static int conf_askvalue(struct symbol *sym, const char *def)
 {
        enum symbol_type type = sym_get_type(sym);
@@ -189,9 +196,7 @@ static int conf_sym(struct menu *menu)
                        printf("/m");
                if (oldval != yes && sym_tristate_within_range(sym, yes))
                        printf("/y");
-               if (menu_has_help(menu))
-                       printf("/?");
-               printf("] ");
+               printf("/?] ");
                if (!conf_askvalue(sym, sym_get_string_value(sym)))
                        return 0;
                strip(line);
@@ -293,10 +298,7 @@ static int conf_choice(struct menu *menu)
                        printf("[1]: 1\n");
                        goto conf_childs;
                }
-               printf("[1-%d", cnt);
-               if (menu_has_help(menu))
-                       printf("?");
-               printf("]: ");
+               printf("[1-%d?]: ", cnt);
                switch (input_mode) {
                case oldconfig:
                        if (!is_new) {
@@ -667,12 +669,3 @@ int main(int ac, char **av)
        }
        return 0;
 }
-
-/*
- * Helper function to facilitate fgets() by Jean Sacren.
- */
-void xfgets(char *str, int size, FILE *in)
-{
-       if (fgets(str, size, in) == NULL)
-               fprintf(stderr, "\nError in reading or end of file.\n");
-}