Commit 1a51bfb8 authored by Warren Dukes's avatar Warren Dukes

fix escaping in quotes. (Now phpMp works again!)

git-svn-id: https://svn.musicpd.org/mpd/trunk@4872 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 00719544
......@@ -38,22 +38,16 @@ int buffer2array(char *buffer, char *array[], const int max)
while (*c != '\0' && i < max) {
if (*c == '\"') {
int escape = 0;
array[i++] = ++c;
while (*c != '\0') {
if (*c == '\"') {
if (escape) {
memmove(c - 1, c,
strlen(c) + 1);
if (*c == '"')
break;
} else {
*(c++) = '\0';
break;
}
} else if (*c == '\\' && escape)
else if (*(c++) == '\\') {
memmove(c - 1, c, strlen(c) + 1);
escape = (*(c++) != '\\') ? 0 : !escape;
++c;
}
}
} else {
while (isWhiteSpace(*c))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment