Blame SOURCES/environment-modules-3.2.10-unload-from-module.patch

5352b7
diff -up modules-3.2.10/ModuleCmd_Load.c.unload_from_modulefile modules-3.2.10/ModuleCmd_Load.c
5352b7
--- modules-3.2.10/ModuleCmd_Load.c.unload_from_modulefile	2014-07-08 10:43:41.615212949 +0200
5352b7
+++ modules-3.2.10/ModuleCmd_Load.c	2014-07-08 13:49:21.674701003 +0200
5352b7
@@ -126,7 +126,7 @@ int	ModuleCmd_Load(	Tcl_Interp	*interp,
5352b7
      **  Set up the flags controling the Tcl callback functions
5352b7
      **/
5352b7
 
5352b7
-	/* avoid changes when invoked as a subcommand */
5352b7
+	/* avoid changes when invoked as a subcommand and loading */
5352b7
 	if (!(g_flags & M_SUBCMD)) {
5352b7
 	    if( load) {
5352b7
 		g_flags |= M_LOAD;
5352b7
@@ -136,6 +136,11 @@ int	ModuleCmd_Load(	Tcl_Interp	*interp,
5352b7
 		g_flags &= ~M_LOAD;
5352b7
 	    }
5352b7
 	    g_flags |= M_SUBCMD;
5352b7
+	} else {
5352b7
+	    if (!load) {
5352b7
+		g_flags |= M_REMOVE;
5352b7
+		g_flags &= ~M_LOAD;
5352b7
+	    }
5352b7
 	}
5352b7
     
5352b7
     /**