279df51388cf7da5474142bc74457f671c74b0ac angie Tue May 14 09:26:57 2019 -0700 dyStringQuoteString needs to escape the escape character in addition to the quote character. diff --git src/lib/dystring.c src/lib/dystring.c index 1fa6c22..0a1a39c 100644 --- src/lib/dystring.c +++ src/lib/dystring.c @@ -229,22 +229,22 @@ memset(ds->string+newSize, ' ', newSize); } ds->string[newSize] = '\0'; ds->stringSize = newSize; } void dyStringQuoteString(struct dyString *dy, char quotChar, char *text) /* Append quotChar-quoted text (with any internal occurrences of quotChar * \-escaped) onto end of dy. */ { char c; dyStringAppendC(dy, quotChar); while ((c = *text++) != 0) { - if (c == quotChar) + if (c == quotChar || c == '\\') dyStringAppendC(dy, '\\'); dyStringAppendC(dy, c); } dyStringAppendC(dy, quotChar); }