From 85cf207e9e59268045bdaeb50f7a1de08b15d864 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Tue, 13 Aug 2024 16:32:07 +0200 Subject: [PATCH] modulecmd: bugfix in test whether a file is a modulefile or not --- Pmodules/modulecmd.bash.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 6637925..3b3fa34 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -470,8 +470,8 @@ is_modulefile() { local -n im_interp="$1" local -r fname="$2" - # does file exist and is readable? - [[ -r ${fname} ]] || return 2 + # is this a regular, readable file? + [[ -f "${fname}" && -r "${fname}"]] || return 2 if [[ "${fname##*.}" == 'lua' ]]; then im_interp="${Lmod_cmd}"