buffer2array: oops, we forgot to take into account that \ is escaped, too

Any escaped instances of \ must already be inside an already
quoted string, though.

git-svn-id: https://svn.musicpd.org/mpd/trunk@4539 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Eric Wong 2006-08-03 04:20:25 +00:00
parent 31a81e2bcf
commit 055e166619

View File

@ -41,7 +41,8 @@ int cstrtok(char *buffer, char *array[], const int max)
*(c++) = '\0'; *(c++) = '\0';
break; break;
} }
} } else if (*c == '\\' && escape)
memmove(c - 1, c, strlen(c) + 1);
escape = (*(c++) != '\\') ? 0 : !escape; escape = (*(c++) != '\\') ? 0 : !escape;
} }
} else { } else {