* If the given line is of the form * " ..." or " ...", return the * location of the separator. Otherwise, return -1. The optional whitespace * is allowed there primarily to allow things like "Bug #43" where is * "Bug" and is "#". * * The separator-starts-line case (in which this function returns 0) is * distinguished from
| 631 | * returns -1) because some callers of this function need such a distinction. |
| 632 | */ |
| 633 | static ssize_t find_separator(const char *line, const char *separators) |
| 634 | { |
| 635 | int whitespace_found = 0; |
| 636 | const char *c; |
| 637 | for (c = line; *c; c++) { |
| 638 | if (strchr(separators, *c)) |
| 639 | return c - line; |
| 640 | if (!whitespace_found && (isalnum(*c) || *c == '-')) |
| 641 | continue; |
| 642 | if (c != line && (*c == ' ' || *c == '\t')) { |
| 643 | whitespace_found = 1; |
| 644 | continue; |
| 645 | } |
| 646 | break; |
| 647 | } |
| 648 | return -1; |
| 649 | } |
| 650 | |
| 651 | /* |
| 652 | * Obtain the token, value, and conf from the given trailer. |
no outgoing calls
no test coverage detected