about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-09-20 14:35:19 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-09-20 14:35:19 +0000
commit7d3d6f4a5a0844b13c729df432b04ba8f60ad477 (patch)
tree87da2648b3a9015edeeda645d23bdd96c20623b1
parent5741e2840f4f905722f453d10a8efcd2486fd9fc (diff)
downloadzsh-7d3d6f4a5a0844b13c729df432b04ba8f60ad477.tar.gz
zsh-7d3d6f4a5a0844b13c729df432b04ba8f60ad477.tar.xz
zsh-7d3d6f4a5a0844b13c729df432b04ba8f60ad477.zip
20391: SHLVL wasn't updated in environment
-rw-r--r--ChangeLog5
-rw-r--r--Src/params.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 56198d5f6..d511f2d5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-20  Peter Stephenson  <pws@csr.com>
+
+	* 20391: Src/params.c: SHLVL didn't get updated in the
+	environment if it was already present.
+
 2004-09-20  Bart Schaefer  <schaefer@zsh.org>
 
 	* 20388: Src/Zle/zle_main.c: arrange that "zle internal-widget"
diff --git a/Src/params.c b/Src/params.c
index 7ba0359b7..98888e7b0 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -594,8 +594,8 @@ createparamtable(void)
 	addenv(pm, pm->u.str);
     pm = (Param) paramtab->getnode(paramtab, "SHLVL");
     sprintf(buf, "%d", (int)++shlvl);
-    if (!(pm->flags & PM_EXPORTED))
-	addenv(pm, buf);
+    /* shlvl value in environment needs updating unconditionally */
+    addenv(pm, buf);
 
     /* Add the standard non-special parameters */
     set_pwd_env();