returns the longest prefix not needing a quote up to maxlen if positive. This stops at the first \0 because it's marked as a character needing an escape */
| 224 | This stops at the first \0 because it's marked as a character needing an |
| 225 | escape */ |
| 226 | static size_t next_quote_pos(const char *s, ssize_t maxlen) |
| 227 | { |
| 228 | size_t len; |
| 229 | if (maxlen < 0) { |
| 230 | for (len = 0; !cq_must_quote(s[len]); len++); |
| 231 | } else { |
| 232 | for (len = 0; len < maxlen && !cq_must_quote(s[len]); len++); |
| 233 | } |
| 234 | return len; |
| 235 | } |
| 236 | |
| 237 | /* |
| 238 | * C-style name quoting. |
no test coverage detected