diff --git a/ChangeLog b/ChangeLog index 7ae3d73ed84..8b81b198926 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4591,8 +4591,12 @@ at Documentation/NuttXConfigVariables.html (2014-4-22). * arch/arm/src/lpc17xx/lpc17_adc.c: Only one ADC pin was configured. Need to configure all that are in the ADC0 set. From MKannan - (2014-4-23). + (2014-4-23). * configs/zkit-arm-1769/src: ADC and SPI/USB MSC updates from MKannan (2014-4-23). * arm/src/armv7-m/ram_vectors.h and arm/src/armv7-m/up_ramvec_initialize.c: Fixes to RAM vector logic from Paul Y. Zhang (2014-4-23) + * tools/kconfig2html.c: Improve behavior of Expand/Collapse + Table of Contents; Handle errors in parsing of strings and in + some uninitialized variables. Add an option to use jQuery. + * tools/mkconfigvar.sh: Fix make target. diff --git a/tools/kconfig2html.c b/tools/kconfig2html.c index de749cb7d01..e29fd47885e 100644 --- a/tools/kconfig2html.c +++ b/tools/kconfig2html.c @@ -52,6 +52,8 @@ * Pre-processor Definitions ****************************************************************************/ +#undef USE_JQUERY + #define LINE_SIZE 1024 #define SCRATCH_SIZE 2048 #define MAX_DEPENDENCIES 100 @@ -902,6 +904,15 @@ static char *get_token(void) /* Search for the trailing quotation mark */ pend = findchar(pbegin + 1, '"'); + + /* Did we find the trailing quotation mark */ + + if (pend) + { + /* Yes.. skip over it */ + + pend++; + } } else { @@ -950,22 +961,43 @@ static char *get_html_string(void) pbegin = strchr(g_lnptr, '"'); if (pbegin) { - /* Skip over the quote */ + /* We found the leading quote. Skip over the leading quote */ pbegin++; + } + else + { + /* The string is unquoted. The beginning of the string is here, + * skipping over any leading whitespace. + */ - /* Search for the trailing quotation mark */ - - pend = findchar(pbegin, '"'); - if (pend) - { - /* Replace the final quote with a NUL */ - - *pend = '\0'; - } + pbegin = skip_space(g_lnptr); + } + + /* Search for the trailing quotation mark. If there is none, then + * the string goes to the end of the line. + */ + + pend = findchar(pbegin, '"'); + if (pend) + { + /* Replace the final quote with a NUL. g_lnptr is set to to + * the next valid character after the terminating quote. + */ + + *pend = '\0'; + g_lnptr = pend + 1; + } + else + { + /* Use the rest of the line. g_lnptr is set to point at the + * terminating NUL. + */ + + pend = pbegin + strlen(pbegin); + g_lnptr = pend; } - g_lnptr = pend + 1; return htmlize_text(pbegin); } @@ -1561,6 +1593,7 @@ static inline char *process_config(FILE *stream, const char *configname, /* Process each line in the configuration */ help = false; + token = NULL; while ((ptr = kconfig_line(stream)) != NULL) { @@ -1734,7 +1767,7 @@ static inline char *process_config(FILE *stream, const char *configname, } } - /* Is this an internal configuration varaible with no description? + /* Is this an internal configuration varaible with no description? * If so, send the output to the appendix file. */ @@ -2108,30 +2141,34 @@ static inline char *process_menu(FILE *stream, const char *kconfigdir) paranum = get_paranum(); if (menu.m_name) { - output("