MCPcopy Create free account
hub / github.com/apache/nuttx / get_html_string

Function get_html_string

tools/kconfig2html.c:954–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952 ****************************************************************************/
953
954static char *get_html_string(void)
955{
956 char *pbegin;
957 char *pend;
958 int len;
959
960 /* Search for the leading quotation mark in the line buffer */
961
962 pbegin = strchr(g_lnptr, '"');
963 if (pbegin)
964 {
965 /* We found the leading quote. Skip over the leading quote */
966
967 pbegin++;
968 }
969 else
970 {
971 /* The string is unquoted. The beginning of the string is here,
972 * skipping over any leading whitespace.
973 */
974
975 pbegin = skip_space(g_lnptr);
976 }
977
978 /* Search for the trailing quotation mark. If there is none, then
979 * the string goes to the end of the line.
980 */
981
982 pend = findchar(pbegin, '"');
983 if (pend)
984 {
985 /* Replace the final quote with a NUL. g_lnptr is set to
986 * the next valid character after the terminating quote.
987 */
988
989 *pend = '\0';
990 g_lnptr = pend + 1;
991 }
992 else
993 {
994 /* Get the length of the string. Return NULL if all that is
995 * left on the line is a NUL string.
996 */
997
998 len = strlen(pbegin);
999 if (len < 1)
1000 {
1001 return NULL;
1002 }
1003
1004 /* Use the rest of the line. g_lnptr is set to point at the
1005 * terminating NUL.
1006 */
1007
1008 pend = pbegin + len;
1009 g_lnptr = pend;
1010 }
1011

Callers 3

process_configFunction · 0.85
process_choiceFunction · 0.85
process_menuFunction · 0.85

Calls 5

findcharFunction · 0.85
htmlize_textFunction · 0.85
skip_spaceFunction · 0.70
strchrFunction · 0.50
strlenFunction · 0.50

Tested by

no test coverage detected