summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2019-03-29 17:42:23 +0100
committerPhilip Hands <phil@hands.com>2022-09-02 17:10:44 +0200
commitdd710e3f35b17eac0baf740a85c7dfed40323b25 (patch)
treefd29df51eee628623d98b7b9ef6e6cf431ded6b9
parent231c39075070d95514b9ccd1ee074ef61cee1a79 (diff)
Revert 9c143ce52da11ec3d21a3491c3749841d3dc10f0 just to make sure the next patch can be applied
Gbp-Pq: Name revert-9c143ce52da11ec3d21a3491c3749841d3dc10f0.patch
-rw-r--r--shell/ash.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/shell/ash.c b/shell/ash.c
index aeccd9aa9..875403295 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11477,17 +11477,9 @@ showvars(const char *sep_prefix, int on, int off)
const char *p;
const char *q;
- p = endofname(*ep);
-/* Used to have simple "p = strchrnul(*ep, '=')" here instead, but this
- * makes "export -p" to have output not suitable for "eval":
- * import os
- * os.environ["test-test"]="test"
- * if os.fork() == 0:
- * os.execv("ash", [ 'ash', '-c', 'eval $(export -p); echo OK' ]) # fixes this
- * os.execv("ash", [ 'ash', '-c', 'env | grep test-test' ])
- */
+ p = strchrnul(*ep, '=');
q = nullstr;
- if (*p == '=')
+ if (*p)
q = single_quote(++p);
out1fmt("%s%s%.*s%s\n", sep_prefix, sep, (int)(p - *ep), *ep, q);
}
@@ -14409,18 +14401,8 @@ init(void)
initvar();
for (envp = environ; envp && *envp; envp++) {
-/* Used to have
- * p = endofname(*envp);
- * if (p != *envp && *p == '=') {
- * here to weed out badly-named variables, but this breaks
- * scenarios where people do want them passed to children:
- * import os
- * os.environ["test-test"]="test"
- * if os.fork() == 0:
- * os.execv("ash", [ 'ash', '-c', 'eval $(export -p); echo OK' ]) # fixes this
- * os.execv("ash", [ 'ash', '-c', 'env | grep test-test' ]) # breaks this
- */
- if (strchr(*envp, '=')) {
+ p = endofname(*envp);
+ if (p != *envp && *p == '=') {
setvareq(*envp, VEXPORT|VTEXTFIXED);
}
}