Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
extension for spawn_parse_args - parse \b \f \n \r \t
  • Loading branch information
perexg committed Oct 29, 2015
1 parent be7381f commit ea20a7c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/spawn.c
Expand Up @@ -377,7 +377,22 @@ spawn_parse_args(char ***argv, int argc, const char *cmd, const char **replace)
while (*s && *s != ' ' && *s != '\\')
s++;
if (*s == '\\') {
memmove(s, s + 1, strlen(s));
l = *(s + 1);
if (l == 'b')
l = '\b';
else if (l == 'f')
l = '\f';
else if (l == 'n')
l = '\n';
else if (l == 'r')
l = '\r';
else if (l == 't')
l = '\t';
else
l = 0;
if (l)
*s++ = l;
memmove(s, s + 1, strlen(s) - 1);
if (*s)
s++;
}
Expand Down

0 comments on commit ea20a7c

Please sign in to comment.