char quote = 0; /* 0 or ' or " */
bool backslash = false; /* whether we've just seen a backslash */
- bool separator = false; /* whether we've just seen a separator */
assert(p);
assert(ret);
}
}
- } else if (separator) {
- for (;; (*p) ++, c = **p) {
- if (c == 0)
- goto finish_force_terminate;
- if (!strchr(separators, c))
- goto finish;
- }
-
} else {
for (;; (*p) ++, c = **p) {
if (c == 0)
(*p) ++;
goto finish_force_next;
}
- separator = true;
- break;
+ /* Skip additional coalesced separators. */
+ for (;; (*p) ++, c = **p) {
+ if (c == 0)
+ goto finish_force_terminate;
+ if (!strchr(separators, c))
+ break;
+ }
+ goto finish;
+
} else {
if (!GREEDY_REALLOC(s, allocated, sz+2))
return -ENOMEM;