From 38b265af02185ab317aaa11bf7445c91d81ba8a5 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 9 Jun 2022 14:36:47 +0200 Subject: [PATCH] modulecmd: bugfix if MODULEPATH starts or ends with a colon --- Pmodules/modulecmd.bash.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 55532a3..5eb3cb1 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -715,6 +715,9 @@ subcommand_load() { LOADEDMODULES="${_LMFILES_}" local dir while read dir; do + # if the first or last character of MODULEPATH is ':', + # we read an empty string. + [[ -z ${dir} ]] && continue [[ "${dir: -1}" == "/" ]] || dir+="/" LOADEDMODULES="${LOADEDMODULES//${dir}}" map_moduledir2ol_name overlay "${dir}"