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 \' */
|
/* in shell, "\'" should yield \' */
|
||||||
if (*src != quote)
|
if (*src != quote) {
|
||||||
*buf++ = '\\';
|
*buf++ = '\\';
|
||||||
|
*buf++ = '\\';
|
||||||
|
}
|
||||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||||
*src == ']') *buf++ = '\\';
|
*src == ']') *buf++ = '\\';
|
||||||
*buf++ = *src;
|
*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 \' */
|
/* in shell, "\'" should yield \' */
|
||||||
if (*src != quote)
|
if (*src != quote) {
|
||||||
*buf++ = '\\';
|
*buf++ = '\\';
|
||||||
|
*buf++ = '\\';
|
||||||
|
}
|
||||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||||
*src == ']') *buf++ = '\\';
|
*src == ']') *buf++ = '\\';
|
||||||
*buf++ = *src;
|
*buf++ = *src;
|
||||||
|
@ -933,8 +933,10 @@ static int parseCommand(char **commandPtr, struct job *job, struct jobSet *jobLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* in shell, "\'" should yield \' */
|
/* in shell, "\'" should yield \' */
|
||||||
if (*src != quote)
|
if (*src != quote) {
|
||||||
*buf++ = '\\';
|
*buf++ = '\\';
|
||||||
|
*buf++ = '\\';
|
||||||
|
}
|
||||||
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
} else if (*src == '*' || *src == '?' || *src == '[' ||
|
||||||
*src == ']') *buf++ = '\\';
|
*src == ']') *buf++ = '\\';
|
||||||
*buf++ = *src;
|
*buf++ = *src;
|
||||||
|
Loading…
Reference in New Issue
Block a user