From e2bb42a4c79cb893b59d3cd80fdb2c442961068c Mon Sep 17 00:00:00 2001 From: Xavier Delaruelle Date: Sun, 7 Jan 2018 22:18:34 +0100 Subject: [PATCH] Specific err on cmdModuleUse when empty dir name --- modulecmd.tcl.in | 3 +++ testsuite/modules.10-use/030-use.exp | 2 +- testsuite/modules.50-cmds/015-use.exp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 9a6dfef4..189c7011 100755 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -5828,6 +5828,9 @@ proc cmdModuleUse {args} { {-p} - {--prepend} - {-prepend} { set pos "prepend" } + {} { + reportError "Directory name empty" + } default { # tranform given path in an absolute path to avoid # dependency to the current work directory. diff --git a/testsuite/modules.10-use/030-use.exp b/testsuite/modules.10-use/030-use.exp index 6eee58dd..329e455f 100644 --- a/testsuite/modules.10-use/030-use.exp +++ b/testsuite/modules.10-use/030-use.exp @@ -30,7 +30,7 @@ regsub "^.*/$tsdirname" $path "$tsdirname" relpath set badpath "$modpath.bad" set mod_path "$path:$modpath" set bad_use "$error_msgs: Directory '$badpath' not found" -set empty_use "$error_msgs: Directory '' not found" +set empty_use "$error_msgs: Directory name empty" set loaded_path "$modpath" regsub "^.*/$tsdirname" $loaded_path "$tsdirname" loaded_relpath regsub "$tsdirname" $loaded_relpath "$tsdirname/../$tsdirname/./" loaded_relpath_wdot diff --git a/testsuite/modules.50-cmds/015-use.exp b/testsuite/modules.50-cmds/015-use.exp index f958cf1e..ee9c1959 100644 --- a/testsuite/modules.50-cmds/015-use.exp +++ b/testsuite/modules.50-cmds/015-use.exp @@ -136,7 +136,7 @@ lappend ans [list setpath LOADEDMODULES $module8] lappend ans [list setpath _LMFILES_ $modulefile8] lappend ans [list ERR] -set err_msg "$error_msgs: Directory '' not found" +set err_msg "$error_msgs: Directory name empty" testouterr_cmd_re "ALL" "load $module8" $ans "$err_msg"