← Commit list

168984067

Denis Vlasenko
Denis Vlasenko
2008-11-25
FAILED Duration: 29s

Subject

ash: fix bad interaction between ash -c '....&' and bash compat

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+6 -2
@@ -9189,8 +9189,9 @@ preadbuffer(void)
while (g_parsefile->strpush) {
#if ENABLE_ASH_ALIAS
- if (parsenleft == -1 && g_parsefile->strpush->ap &&
- parsenextc[-1] != ' ' && parsenextc[-1] != '\t') {
+ if (parsenleft == -1 && g_parsefile->strpush->ap
+ && parsenextc[-1] != ' ' && parsenextc[-1] != '\t'
+ ) {
return PEOA;
}
#endif
@@ -9314,6 +9315,9 @@ pfgets(char *line, int len)
static void
pungetc(void)
{
+ /* check is needed for ash -c 'echo 5&' + BASH_COMPAT to work */
+ if (parsenleft < 0)
+ return;
parsenleft++;
parsenextc--;
}