← Commit list

f7eea8c23

Denys Vlasenko
Denys Vlasenko
2020-02-16
SUCCESS Duration: 151s

Subject

ash: parser: Fix incorrect eating of backslash newlines

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+8 -2
@@ -10829,6 +10829,12 @@ struct synstack {
struct synstack *next;
};
+static int
+pgetc_top(struct synstack *stack)
+{
+ return stack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
+}
+
static void
synstack_push(struct synstack **stack, struct synstack *next, int syntax)
{
@@ -12194,7 +12200,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
}
USTPUTC(c, out);
nlprompt();
- c = synstack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
+ c = pgetc_top(synstack);
goto loop; /* continue outer loop */
case CWORD:
USTPUTC(c, out);
@@ -12345,7 +12351,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
IF_ASH_ALIAS(if (c != PEOA))
USTPUTC(c, out);
}
- c = synstack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
+ c = pgetc_top(synstack);
} /* for (;;) */
endword: