← Commit list

680c3016a

Denys Vlasenko
Denys Vlasenko
2018-04-11
SUCCESS Duration: 148s

Subject

ash: parser: Allow newlines within parameter substitution

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+4 -1
@@ -11999,8 +11999,11 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */
switch (SIT(c, synstack->syntax)) {
case CNL: /* '\n' */
- if (synstack->syntax == BASESYNTAX)
+ if (synstack->syntax == BASESYNTAX
+ && !synstack->varnest
+ ) {
goto endword; /* exit outer loop */
+ }
USTPUTC(c, out);
nlprompt();
c = pgetc();
shell/ash_test/ash-vars/param_expand_alt2.right+4 -0
@@ -0,0 +1,4 @@
+Unquoted: H H
+Quoted: H
+H
+Ok:0
shell/ash_test/ash-vars/param_expand_alt2.tests+7 -0
@@ -0,0 +1,7 @@
+echo Unquoted: H${$+
+}H
+
+echo Quoted: "H${$+
+}H"
+
+echo Ok:$?
shell/hush_test/hush-vars/param_expand_alt2.right+4 -0
@@ -0,0 +1,4 @@
+Unquoted: H H
+Quoted: H
+H
+Ok:0
shell/hush_test/hush-vars/param_expand_alt2.tests+7 -0
@@ -0,0 +1,7 @@
+echo Unquoted: H${$+
+}H
+
+echo Quoted: "H${$+
+}H"
+
+echo Ok:$?