break;
}
- if (unescape && (*p == '\\')) {
+ if (*p != '\\') {
+ *s++ = *p++;
+ continue;
+ }
+
+ if (unescape) {
p++;
switch (*p) {
break;
}
p++;
- continue;
- }
- /*
- * Deal with quotes and escapes, but don't mash
- * escaped characters into their non-escaped
- * equivalent.
- */
- if (!unescape && (*p == '\\')) {
+ } else {
+ /*
+ * Deal with quotes and escapes, but don't mash
+ * escaped characters into their non-escaped
+ * equivalent.
+ */
if (!p[1]) continue; /* force end of string */
if (p[1] == quote) { /* convert '\'' --> ' */
*(s++) = *(p++);
}
*(s++) = *(p++);
- continue;
}
-
- *s++ = *p++;
}
*s++ = 0;