Fix incorrect pointer increment
When encountering a backslash character the memmove() call removes it. But then the pointer p should only be incremented by 1 to skip the escaped character rather than 2, which also skips the character following the escaped one.
This commit is contained in:

committed by
Jeffrey Altman

parent
70ac849844
commit
72055a2911
@@ -248,7 +248,7 @@ sl_make_argv(char *line, int *ret_argc, char ***ret_argv)
|
|||||||
if (p[1] == '\0')
|
if (p[1] == '\0')
|
||||||
goto failed;
|
goto failed;
|
||||||
memmove(&p[0], &p[1], strlen(&p[1]) + 1);
|
memmove(&p[0], &p[1], strlen(&p[1]) + 1);
|
||||||
p += 2;
|
p += 1;
|
||||||
continue;
|
continue;
|
||||||
} else if (quote || !isspace((unsigned char)*p)) {
|
} else if (quote || !isspace((unsigned char)*p)) {
|
||||||
p++;
|
p++;
|
||||||
|
Reference in New Issue
Block a user