From c6ea07e6adf8613fab7f37baed0a82e246c59962 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 29 Jan 2026 16:55:54 +0100 Subject: [PATCH] modulecmd: use of unset variable fixed in find_modulefile() --- CHANGELOG.md | 2 ++ Pmodules/modulecmd.bash.in | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20a9e20..3afec6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Version 2.0.4 ### modulecmd +* Use of unset variable fixed in find_modulefile(). + (#1358) * When loading multiple modules, `LD_LIBRARY_PATH` may not have been set correctly. (#1354) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index fdb9d52..d277ea1 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1406,14 +1406,14 @@ find_modulefile(){ local -a modulepath=() IFS=':' read -r -a modulepath <<<"${MODULEPATH}" - if [[ "${m:0:1}" = '/' || -r "${m}" ]]; then + if [[ "${modulename:0:1}" = '/' || -r "${modulename}" ]]; then # handle absolut or relative module names local -- absname=$(std::get_abspath "${m}") local -- ol_name='' local -- group='' find_overlay ol_name group "${absname}" [[ "${ol_name}" != 'none' ]] && \ - die_ol_absname_not_allowed "${m}" + die_ol_absname_not_allowed "${modulename}" ref_modulefile="${absname}" ref_relstage='stable' ref_moduledir="${absname%/*}"