Append a single token to `tokens` if there's capacity. Consolidates the * `if (count < max_tokens) { tokens[count++] = strdup(...); }` pattern. */
| 134 | /* Append a single token to `tokens` if there's capacity. Consolidates the |
| 135 | * `if (count < max_tokens) { tokens[count++] = strdup(...); }` pattern. */ |
| 136 | static int push_pattern_token(char **tokens, int count, int max_tokens, const char *text) { |
| 137 | if (count >= max_tokens) { |
| 138 | return count; |
| 139 | } |
| 140 | tokens[count] = cbm_mem_strdup(CBM_MEM_CLASS_SEMANTIC, text); |
| 141 | return tokens[count] ? count + SKIP_ONE : count; |
| 142 | } |
| 143 | |
| 144 | /* True if `s` contains any of the space-separated substrings in `needles`. */ |
| 145 | static bool has_any(const char *s, const char *const *needles) { |
no test coverage detected