* Return the position of the first alphabetic character in a string. */
| 517 | * Return the position of the first alphabetic character in a string. |
| 518 | */ |
| 519 | int 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 |
no outgoing calls
no test coverage detected