These are compile-time project constants containing simple space-separated * argv tokens, not user command text. No shell quoting or expansion is used. */
| 192 | /* These are compile-time project constants containing simple space-separated |
| 193 | * argv tokens, not user command text. No shell quoting or expansion is used. */ |
| 194 | static bool gf_split_flags(cbm_git_facts_t *facts, const char *literal, const char **tokens, |
| 195 | int *count) { |
| 196 | *count = 0; |
| 197 | char *copy = cbm_arena_strdup(&facts->arena, literal); |
| 198 | if (!copy) |
| 199 | return false; |
| 200 | char *p = copy; |
| 201 | while (*p) { |
| 202 | while (*p == ' ') |
| 203 | p++; |
| 204 | if (!*p) |
| 205 | break; |
| 206 | if (*count == GF_FLAG_CAP) |
| 207 | return false; |
| 208 | tokens[(*count)++] = p; |
| 209 | while (*p && *p != ' ') { |
| 210 | if (*p == '\t' || *p == '\n' || *p == '\r' || *p == '\'' || *p == '"') |
| 211 | return false; |
| 212 | p++; |
| 213 | } |
| 214 | if (*p) |
| 215 | *p++ = '\0'; |
| 216 | } |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | #ifdef _WIN32 |
| 221 | /* Same owner-only, protected, inheritable ACL as compat.c's private helper, |
no test coverage detected