summaryrefslogtreecommitdiff
path: root/app-shells/dash/files/dash-0.5.10.1-parser.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-05-15 13:19:56 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-05-15 13:19:56 +0100
commitd302a5d7fc9caafba5c8a404f2891bb6ccdec311 (patch)
tree2a3ee43f080d1d0086964de8c29ccf1021fdfda7 /app-shells/dash/files/dash-0.5.10.1-parser.patch
parentea31ad0ed5501d0bf92267c35beaf06ac016bad2 (diff)
gentoo resync : 15.05.2018
Diffstat (limited to 'app-shells/dash/files/dash-0.5.10.1-parser.patch')
-rw-r--r--app-shells/dash/files/dash-0.5.10.1-parser.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/app-shells/dash/files/dash-0.5.10.1-parser.patch b/app-shells/dash/files/dash-0.5.10.1-parser.patch
new file mode 100644
index 000000000000..485fc7e6772a
--- /dev/null
+++ b/app-shells/dash/files/dash-0.5.10.1-parser.patch
@@ -0,0 +1,43 @@
+https://www.mail-archive.com/dash@vger.kernel.org/msg01620.html
+
+--- dash-0.5.10.1/src/parser.c
++++ dash-0.5.10.1/src/parser.c
+@@ -853,6 +853,11 @@
+ return c;
+ }
+
++static int pgetc_top(struct synstack *stack)
++{
++ return stack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
++}
++
+ static void synstack_push(struct synstack **stack, struct synstack *next,
+ const char *syntax)
+ {
+@@ -915,7 +920,7 @@
+ attyline();
+ if (synstack->syntax == BASESYNTAX)
+ return readtoken();
+- c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
++ c = pgetc_top(synstack);
+ goto loop;
+ }
+ #endif
+@@ -929,7 +934,7 @@
+ goto endword; /* exit outer loop */
+ USTPUTC(c, out);
+ nlprompt();
+- c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
++ c = pgetc_top(synstack);
+ goto loop; /* continue outer loop */
+ case CWORD:
+ USTPUTC(c, out);
+@@ -1056,7 +1061,7 @@
+ USTPUTC(c, out);
+ }
+ }
+- c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
++ c = pgetc_top(synstack);
+ }
+ }
+ endword: