Skip to content

Commit 35e5597

Browse files
committed
Inhibit rcexpandparam Zsh option when initializing
Protect quarantine mechanism code from 'rcexpandparam' Zsh option when initializing the module command on this shell. Fixes #403
1 parent 1159bfe commit 35e5597

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

NEWS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ Modules 4.8.0 (not yet released)
119119
* Init: fix stderr redirection in fish shell initialization script, now that
120120
use of the ``^`` character to redirect stderr is disabled by default (fish
121121
>=3.3).
122+
* Protect quarantine mechanism code from ``rcexpandparam`` Zsh option when
123+
initializing the :command:`module` command on this shell. (fix issue #403)
122124

123125

124126
.. _4.7 release notes:

init/zsh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@quarantinesupport@
3737
# define module command and surrounding initial environment (default value
3838
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init config files)
39-
@quarantinesupport@_mlcode=`${=_mlre:-}@TCLSH@ @libexecdir@/modulecmd.tcl zsh autoinit`
39+
@quarantinesupport@_mlcode=`${^^=_mlre:-}@TCLSH@ @libexecdir@/modulecmd.tcl zsh autoinit`
4040
@notquarantinesupport@_mlcode=`@TCLSH@ @libexecdir@/modulecmd.tcl zsh autoinit`
4141
_mlret=$?
4242

modulecmd.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8024,7 +8024,7 @@ alias ml 'module ml \!*' ;}
80248024
# these variables that should have been local are unset at the end
80258025

80268026
# on zsh, word splitting should be enabled explicitly
8027-
set wsplit [expr {[getState shell] eq {zsh} ? {=} : {}}]
8027+
set wsplit [expr {[getState shell] eq {zsh} ? {^^=} : {}}]
80288028
# only redirect module from stderr to stdout when session is
80298029
# attached to a terminal to avoid breaking non-terminal session
80308030
# (scp, sftp, etc)

testsuite/modules.70-maint/120-autoinit.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ set func_quar_zsh "\\s*unset _mlre _mlIFS;
129129
\\s*_mlIFS=\\\$IFS;
130130
\\s*fi;
131131
\\s*IFS=' ';
132-
\\s*for _mlv in \\\${=MODULES_RUN_QUARANTINE:-}; do
132+
\\s*for _mlv in \\\${\\^\\^=MODULES_RUN_QUARANTINE:-}; do
133133
$end_quar_sh\n"
134134
} else {
135135
set end_quar_sh ""
@@ -185,7 +185,7 @@ set func_modcmd_ksh "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then
185185
\\s*eval `$tclshlocre $modulecmd_pathre ksh \"\\$\\@\"`;
186186
\\s*fi;"
187187
set func_modcmd_zsh "\\s*if \\\[ -n \"\\\${_mlre:-}\" \\\]; then
188-
\\s*eval `eval \\\${=_mlre} $tclshlocre $modulecmd_pathre zsh '\"\\$\\@\"'`;
188+
\\s*eval `eval \\\${\\^\\^=_mlre} $tclshlocre $modulecmd_pathre zsh '\"\\$\\@\"'`;
189189
\\s*else
190190
\\s*eval `$tclshlocre $modulecmd_pathre zsh \"\\$\\@\"`;
191191
\\s*fi;"

0 commit comments

Comments
 (0)