foo = "\
bar \
baz"
--> foo = "bar baz"
Makes dealing with long queries much easier.
char buf2[8192];
char buf3[8192];
int t1, t2, t3;
+ int spaces = FALSE;
char *cbuf = buf;
size_t len;
return -1;
}
+ if (spaces) {
+ ptr = cbuf;
+ while (isspace((int) *ptr)) ptr++;
+
+ if (ptr > cbuf) {
+ memmove(cbuf, ptr, len - (ptr - cbuf));
+ len -= (ptr - cbuf);
+ }
+ }
+
/*
* Not doing continuations: check for edge
* conditions.
}
if ((len > 0) && (cbuf[len - 1] == '\\')) {
+ /*
+ * Check for "suppress spaces" magic.
+ */
+ if (!spaces && (len > 2) && (cbuf[len - 2] == '"')) {
+ spaces = TRUE;
+ }
+
cbuf[len - 1] = '\0';
cbuf += len - 1;
continue;
}
ptr = cbuf = buf;
+ spaces = FALSE;
/*
* The parser is getting to be evil.