mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-26 13:10:30 +00:00
Patch from Matt Kraai to fox sh.c escape problem such that
running things like 'echo "\n\tHi\n\t\!"' and 'echo -e "\n\tHi\n\t\!"' behave as under bash.
This commit is contained in:
parent
59ec601b8e
commit
b2356f6de9
4
lash.c
4
lash.c
@ -933,8 +933,10 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
||||
}
|
||||
|
||||
/* in shell, "\'" should yield \' */
|
||||
if (*src != quote)
|
||||
if (*src != quote) {
|
||||
*buf++ = '\\';
|
||||
*buf++ = '\\';
|
||||
}
|
||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||
*src == ']') *buf++ = '\\';
|
||||
*buf++ = *src;
|
||||
|
4
sh.c
4
sh.c
@ -933,8 +933,10 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
||||
}
|
||||
|
||||
/* in shell, "\'" should yield \' */
|
||||
if (*src != quote)
|
||||
if (*src != quote) {
|
||||
*buf++ = '\\';
|
||||
*buf++ = '\\';
|
||||
}
|
||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||
*src == ']') *buf++ = '\\';
|
||||
*buf++ = *src;
|
||||
|
@ -933,8 +933,10 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
||||
}
|
||||
|
||||
/* in shell, "\'" should yield \' */
|
||||
if (*src != quote)
|
||||
if (*src != quote) {
|
||||
*buf++ = '\\';
|
||||
*buf++ = '\\';
|
||||
}
|
||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||
*src == ']') *buf++ = '\\';
|
||||
*buf++ = *src;
|
||||
|
Loading…
Reference in New Issue
Block a user