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

Function dequote

tools/kconfig2html.c:415–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413 ****************************************************************************/
414
415static char *dequote(char *ptr)
416{
417 int len;
418
419 /* Check if there is a trailing quote */
420
421 len = strlen(ptr);
422 if (ptr[len - 1] == '"')
423 {
424 /* Yes... replace it with a terminator */
425
426 ptr[len - 1] = '\0';
427 len--;
428 }
429
430 /* Is there a leading quote? */
431
432 if (ptr[0] == '"')
433 {
434 /* Yes.. skip over the leading quote */
435
436 ptr++;
437 len--;
438 }
439
440 /* Handle the case where nothing is left after dequoting */
441
442 if (len <= 0)
443 {
444 ptr = NULL;
445 }
446
447 return ptr;
448}
449
450/****************************************************************************
451 * Name: htmlize_character

Callers 1

parse_kconfigfileFunction · 0.85

Calls 1

strlenFunction · 0.50

Tested by

no test coverage detected