Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix spawn_parse_args() - for latest change
  • Loading branch information
perexg committed Oct 29, 2015
1 parent 787c676 commit f1d7918
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/spawn.c
Expand Up @@ -374,8 +374,6 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
s++;
f = s;
while (*s && *s != ' ') {
while (*s && *s != ' ' && *s != '\\')
s++;
if (*s == '\\') {
l = *(s + 1);
if (l == 'b')
Expand All @@ -390,11 +388,16 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
l = '\t';
else
l = 0;
if (l)
if (l) {
*s++ = l;
memmove(s, s + 1, strlen(s) - 1);
if (*s)
s++;
memmove(s, s + 1, strlen(s));
} else {
memmove(s, s + 1, strlen(s));
if (*s)
s++;
}
} else {
s++;
}
}
if (f != s) {
Expand Down

0 comments on commit f1d7918

Please sign in to comment.