/* 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.  */
static ssize_t next_quote_pos(const char *s, ssize_t maxlen)
/* 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.  */
static ssize_t next_quote_pos(const char *s, ssize_t maxlen)
{
	ssize_t len;
	if (maxlen < 0) {
		for (len = 0; !sq_must_quote(s[len]); len++);
	} else {
		for (len = 0; len < maxlen && !sq_must_quote(s[len]); len++);
	}
	return len;
}