diff --git a/tools/kconfig2html.c b/tools/kconfig2html.c index 532522c16e..c5b3f3cbd4 100644 --- a/tools/kconfig2html.c +++ b/tools/kconfig2html.c @@ -1033,16 +1033,16 @@ static inline char *process_config(FILE *stream, const char *configname, char *value; int ndx; - ndx = config.cnselect + 1; - if (ndx > MAX_SELECT) + ndx = config.cnselect; + if (ndx >= MAX_SELECT) { fprintf(stderr, "Too many 'select' lines\n"); exit(ERROR_TOO_MANY_SELECT); } - value = strtok_r(NULL, " ", &g_lasts); + value = strtok_r(NULL, " ", &g_lasts); config.cselect[ndx] = strdup(value); - config.cnselect = ndx; + config.cnselect = ndx + 1; token = NULL; } break; @@ -1100,7 +1100,7 @@ static inline char *process_config(FILE *stream, const char *configname, { /* Print the configuration variable name and the short description */ - body("

", config.cname); + body("

", config.cname); /* If we are not in a choice block, than give the variable a paragraph * number and put it in the table of contents. @@ -1109,7 +1109,7 @@ static inline char *process_config(FILE *stream, const char *configname, if (!g_inchoice) { paranum = get_paranum(); - output("
  • %s CONFIG_%s", + output("
  • %s CONFIG_%s", config.cname, paranum, config.cname); body("%s ", paranum); incr_paranum(); @@ -1175,12 +1175,12 @@ static inline char *process_config(FILE *stream, const char *configname, if (config.cnselect > 0) { - body("
  • Selects: CONFIG_%s", + body("
  • Selects: CONFIG_%s", config.cselect[0], config.cselect[0]); for (i = 1; i < config.cnselect; i++) { - body(", CONFIG_%s", + body(", CONFIG_%s", config.cselect[i], config.cselect[i]); } @@ -1541,11 +1541,13 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir) g_menu_number, paranum); } + g_menu_number++; + /* Print the list of dependencies (if any) */ + body("
      \n"); if (g_ndependencies > 0) { - body("
        \n"); body("
      • Dependencies: %s", g_dependencies[0]); for (i = 1; i < g_ndependencies; i++) @@ -1554,10 +1556,12 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir) } body("
      • \n"); - body("
      \n"); } - g_menu_number++; + /* Show the configuration file */ + + body("
    • Kconfig file: %s/Kconfig\n", kconfigdir); + body("
    \n"); /* Remove any dependencies that apply only to this configuration */ @@ -1918,9 +1922,9 @@ int main(int argc, char **argv, char **envp) incr_level(); paranum = get_paranum(); - output("
  • %s NuttX Configuration Variables
  • \n", + output("
  • %s Menu: Main
  • \n", g_menu_number, paranum); - body("

    %s NuttX Configuration Variables

    \n", + body("

    %s Menu: Main

    \n", g_menu_number, paranum); g_menu_number++;