From a53bf42479c8c4d39664785838f7d72f590bb565 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 22 Apr 2021 09:41:06 +0200 Subject: [PATCH] modulecmd: use IFS saved as the beginning for restoring --- Pmodules/modulecmd.bash.in | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index cd7afdc..ed2c61d 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -476,10 +476,9 @@ subcommand_load() { "No module specified" fi - local saved_IFS="${IFS}"; IFS=':' local -a modulepath=(${MODULEPATH}) - IFS=${saved_IFS} + IFS=${__IFS} local m='' for m in "${args[@]}"; do @@ -900,10 +899,9 @@ get_available_modules() { # if no modulefile could be found # find_module() { - local saved_IFS=${IFS}; IFS=':' local -a dirs=($3) - IFS=${saved_IFS} + IFS=${__IFS} local -r module="$4" for dir in "${dirs[@]}"; do @@ -1519,10 +1517,9 @@ unuse directory|group|release... subcommand_unuse() { local -r subcommand='unuse' - local saved_IFS=${IFS}; IFS=':' local -a modulepath=(${MODULEPATH}) - IFS=${saved_IFS} + IFS=${__IFS} unuse() { unuse_overlay() { @@ -2275,10 +2272,9 @@ subcommand_search() { shift done if [[ -z "${src_prefix}" ]]; then - local saved_IFS="${IFS}"; IFS=':' local -a src_prefix=(${PMODULES_OVERLAYS}) - IFS=${saved_IFS} + IFS=${__IFS} fi if [[ "${opt_use_releases}" == ":" ]]; then