From ffbf6158e61c8bd08e72a7ce822c834864eb12fa Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 3 Aug 2022 16:41:15 +0200 Subject: [PATCH] modulecmd: unset 'Version' before restoring variables from cache If 'Version' is set in the calling shell, initialisation might be skipped. --- Pmodules/modulecmd.bash.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index cecce8a..92ecf4d 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -2882,6 +2882,8 @@ if [[ -z "${Subcommands[${subcommand}]}" ]]; then std::die 1 "${CMD}: unknown sub-command -- ${subcommand}" fi +# restore variables from last call +unset Version if [[ -n ${PMODULES_ENV} ]]; then eval "$("${base64}" -d <<< "${PMODULES_ENV}" 2>/dev/null)" fi