summaryrefslogtreecommitdiff
path: root/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch')
-rw-r--r--app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
new file mode 100644
index 000000000000..94740223fc8e
--- /dev/null
+++ b/app-shells/dash/files/dash-0.5.11.3-check_nflag_in_evaltree.patch
@@ -0,0 +1,46 @@
+From 29d6f2148f10213de4e904d515e792d2cf8c968e Mon Sep 17 00:00:00 2001
+From: Herbert Xu <herbert@gondor.apana.org.au>
+Date: Thu, 4 Jun 2020 21:53:55 +1000
+Subject: eval: Check nflag in evaltree instead of cmdloop
+
+This patch moves the nflag check from cmdloop into evaltree. This
+is so that nflag will be in force even if we enter the shell via a
+path other than cmdloop, e.g., through sh -c.
+
+Reported-by: Joey Hess <id@joeyh.name>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+---
+ src/eval.c | 3 +++
+ src/main.c | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/eval.c b/src/eval.c
+index d10be38..9476fbb 100644
+--- a/src/eval.c
++++ b/src/eval.c
+@@ -213,6 +213,9 @@ evaltree(union node *n, int flags)
+
+ setstackmark(&smark);
+
++ if (nflag)
++ goto out;
++
+ if (n == NULL) {
+ TRACE(("evaltree(NULL) called\n"));
+ goto out;
+diff --git a/src/main.c b/src/main.c
+index 7a28534..5c49fdc 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -233,7 +233,7 @@ cmdloop(int top)
+ out2str("\nUse \"exit\" to leave shell.\n");
+ }
+ numeof++;
+- } else if (nflag == 0) {
++ } else {
+ int i;
+
+ job_warning = (job_warning == 2) ? 1 : 0;
+--
+cgit 1.2.3-1.el7
+