if an XSCHEM_LIBRARY_PATH item contains "../" somewhere in the directory path apply [file normalize ... ] to resolve the ../../path/ path to an absolute location.

This commit is contained in:
Stefan Frederik 2021-04-16 13:31:20 +02:00
parent 7d4c208027
commit 99b0ab2ee2
1 changed files with 6 additions and 4 deletions

View File

@ -3078,11 +3078,11 @@ proc get_file_path {ff} {
# Linux Windows
if { [regexp {^/} $ff] || [regexp {^[a-zA-Z]:} $ff] } { return $ff }
if {$::OS == "Windows"} {
set pathlist [split $env(PATH) \;]
set mylist [split $env(PATH) \;]
} else {
set pathlist [split $env(PATH) :]
set mylist [split $env(PATH) :]
}
foreach i $pathlist {
foreach i $mylist {
set ii $i/$ff
if { [file exists $ii]} {return $ii}
}
@ -3389,8 +3389,10 @@ proc set_paths {} {
regsub {^~} $i $env(HOME) i
if { ![string compare $i .] } {
lappend pathlist $i
} elseif { [ regexp {\.\.\/} $i] } {
lappend pathlist [file normalize $i]
} elseif { [ file exists $i] } {
lappend pathlist ${i}
lappend pathlist $i
}
}
}