mirror of
https://github.com/StefanSchippers/xschem.git
synced 2026-08-22 06:07:29 +02:00
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:
+6
-4
@@ -3078,11 +3078,11 @@ proc get_file_path {ff} {
|
|||||||
# Linux Windows
|
# Linux Windows
|
||||||
if { [regexp {^/} $ff] || [regexp {^[a-zA-Z]:} $ff] } { return $ff }
|
if { [regexp {^/} $ff] || [regexp {^[a-zA-Z]:} $ff] } { return $ff }
|
||||||
if {$::OS == "Windows"} {
|
if {$::OS == "Windows"} {
|
||||||
set pathlist [split $env(PATH) \;]
|
set mylist [split $env(PATH) \;]
|
||||||
} else {
|
} else {
|
||||||
set pathlist [split $env(PATH) :]
|
set mylist [split $env(PATH) :]
|
||||||
}
|
}
|
||||||
foreach i $pathlist {
|
foreach i $mylist {
|
||||||
set ii $i/$ff
|
set ii $i/$ff
|
||||||
if { [file exists $ii]} {return $ii}
|
if { [file exists $ii]} {return $ii}
|
||||||
}
|
}
|
||||||
@@ -3389,8 +3389,10 @@ proc set_paths {} {
|
|||||||
regsub {^~} $i $env(HOME) i
|
regsub {^~} $i $env(HOME) i
|
||||||
if { ![string compare $i .] } {
|
if { ![string compare $i .] } {
|
||||||
lappend pathlist $i
|
lappend pathlist $i
|
||||||
|
} elseif { [ regexp {\.\.\/} $i] } {
|
||||||
|
lappend pathlist [file normalize $i]
|
||||||
} elseif { [ file exists $i] } {
|
} elseif { [ file exists $i] } {
|
||||||
lappend pathlist ${i}
|
lappend pathlist $i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user