summaryrefslogtreecommitdiffstats
path: root/el6/environment-modules-3.2.10-unload-from-module.patch
diff options
context:
space:
mode:
Diffstat (limited to 'el6/environment-modules-3.2.10-unload-from-module.patch')
-rw-r--r--el6/environment-modules-3.2.10-unload-from-module.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/el6/environment-modules-3.2.10-unload-from-module.patch b/el6/environment-modules-3.2.10-unload-from-module.patch
new file mode 100644
index 0000000..c848752
--- /dev/null
+++ b/el6/environment-modules-3.2.10-unload-from-module.patch
@@ -0,0 +1,24 @@
+diff -up modules-3.2.10/ModuleCmd_Load.c.unload_from_modulefile modules-3.2.10/ModuleCmd_Load.c
+--- modules-3.2.10/ModuleCmd_Load.c.unload_from_modulefile 2014-07-08 10:43:41.615212949 +0200
++++ modules-3.2.10/ModuleCmd_Load.c 2014-07-08 13:49:21.674701003 +0200
+@@ -126,7 +126,7 @@ int ModuleCmd_Load( Tcl_Interp *interp,
+ ** Set up the flags controling the Tcl callback functions
+ **/
+
+- /* avoid changes when invoked as a subcommand */
++ /* avoid changes when invoked as a subcommand and loading */
+ if (!(g_flags & M_SUBCMD)) {
+ if( load) {
+ g_flags |= M_LOAD;
+@@ -136,6 +136,11 @@ int ModuleCmd_Load( Tcl_Interp *interp,
+ g_flags &= ~M_LOAD;
+ }
+ g_flags |= M_SUBCMD;
++ } else {
++ if (!load) {
++ g_flags |= M_REMOVE;
++ g_flags &= ~M_LOAD;
++ }
+ }
+
+ /**