Skip to content

Commit df1cdab

Browse files
kiwiroyxdelaruelle
authored andcommitted
Use absolute path to load tcl_ext_lib
Fixes #344
1 parent c0a3367 commit df1cdab

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

modulecmd.tcl.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11085,7 +11085,7 @@ if {[catch {
1108511085
# Load extension library if enabled
1108611086
@libtclenvmodules@if {[file readable [getConf tcl_ext_lib]]} {
1108711087
@libtclenvmodules@ reportDebug "Load Tcl extension library ([getConf tcl_ext_lib])"
11088-
@libtclenvmodules@ load [getConf tcl_ext_lib] Envmodules
11088+
@libtclenvmodules@ load [file normalize [getConf tcl_ext_lib]] Envmodules
1108911089
@libtclenvmodules@ set g_tclextlib_loaded 1
1109011090
@libtclenvmodules@}
1109111091
# use fallback procs if extension library is not loaded

testsuite/modules.00-init/150-access-init.exp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ if {[info exists tclextlib_file]} {
5454
# replace Tcl extension library by a non lib file
5555
file rename $tclextlib_file $tclextlib_file.orig
5656
file copy lib/envmodules.c $tclextlib_file
57+
set tclextlib_file_abs_re [regsub -all "\(\[.+?\]\)" [file normalize $tclextlib_file] {\\\1}]
5758
if {$tcl_platform(os) eq {Darwin}} {
58-
set tserr "$error_msgs: dlopen\\\($tclextlib_file,.*"
59+
set tserr "$error_msgs: dlopen\\\($tclextlib_file_abs_re,.*"
5960
} else {
60-
set tserr "$error_msgs: couldn't load file \"$tclextlib_file\":.*"
61+
set tserr "$error_msgs: couldn't load file \"$tclextlib_file_abs_re\":.*"
6162
}
6263
testouterr_cmd_re sh {-V} {} $tserr
6364
file delete $tclextlib_file
6465
file rename $tclextlib_file.orig $tclextlib_file
6566
unset tserr
67+
unset tclextlib_file_abs_re
6668
}
6769

6870
# restrict read access to site-specific configuration script

0 commit comments

Comments
 (0)