MCPcopy Create free account
hub / github.com/Entware/Entware / first_alpha

Function first_alpha

scripts/config/lxdialog/util.c:519–536  ·  view source on GitHub ↗

* Return the position of the first alphabetic character in a string. */

Source from the content-addressed store, hash-verified

517 * Return the position of the first alphabetic character in a string.
518 */
519int first_alpha(const char *string, const char *exempt)
520{
521 int i, in_paren = 0, c;
522
523 for (i = 0; i < strlen(string); i++) {
524 c = tolower(string[i]);
525
526 if (strchr("<[(", c))
527 ++in_paren;
528 if (strchr(">])", c) && in_paren > 0)
529 --in_paren;
530
531 if ((!in_paren) && isalpha(c) && strchr(exempt, c) == 0)
532 return i;
533 }
534
535 return 0;
536}
537
538/*
539 * ncurses uses ESC to detect escaped char sequences. This resutl in

Callers 2

do_print_itemFunction · 0.85
dialog_menuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected