fix rel_sym_path when XSCHEM_LIBTRARY_PATH contains paths with trailing `/`

This commit is contained in:
stefan schippers 2023-11-11 11:30:27 +01:00
parent 6bace90b41
commit f3aac428a4
2 changed files with 11 additions and 4 deletions

View File

@ -219,6 +219,9 @@
<Component Id="CMPMAKESCHFROMSPICEAWK">
<File Id="MAKESCHFROMSPICEAWK" KeyPath="yes" Source="../../src/make_sch_from_spice.awk" />
</Component>
<Component Id="CMPMAKESYMFROMSPICEAWK">
<File Id="MAKESYMFROMSPICE" KeyPath="yes" Source="../../src/make_sym_from_spice.awk" />
</Component>
<Component Id="CMPMAKEVHDLFROMSPICEAWK">
<File Id="MAKEVHDLFROMSPICEAWK" KeyPath="yes" Source="../../src/make_vhdl_from_spice.awk" />
</Component>
@ -249,7 +252,7 @@
<Component Id="CMPPLACESYMPINS">
<File Id="PLACESYMPINS" KeyPath="yes" Source="../../src/place_sym_pins.tcl" />
</Component>
<Directory Id="SYSTEMLIBFOLDER" Name="systemlib">
<Component Id="CMPSYSTEMLIBFONTSCH">
<File Id="FONTSCH" KeyPath="yes" Source="../../src/systemlib/font.sch" />
@ -347,6 +350,7 @@
<ComponentRef Id="CMPMAKEEDITAWK" />
<ComponentRef Id="CMPMAKESCHFROMCADENCEPINAWK" />
<ComponentRef Id="CMPMAKESCHFROMSPICEAWK" />
<ComponentRef Id="CMPMAKESYMFROMSPICEAWK" />
<ComponentRef Id="CMPMAKESCHFROMVHDLAWK" />
<ComponentRef Id="CMPMAKESYMAWK" />
<ComponentRef Id="CMPMAKESYMLCCAWK" />
@ -367,8 +371,8 @@
<ComponentRef Id="CMPTRACKMEMORYAWK" />
<ComponentRef Id="CMPTRADUCIAWK" />
<ComponentRef Id="CMPPLACEPLINS" />
<ComponentRef Id="CMPPLACESYMPINS" />
<ComponentRef Id="CMPVERILOGAWK" />
<ComponentRef Id="CMPPLACESYMPINS" />
<ComponentRef Id="CMPVERILOGAWK" />
<ComponentRef Id="CMPVHDLAWK" />
<ComponentRef Id="CMPXSCHEMHELP" />
<ComponentRef Id="CMPSYSTEMLIBFONTSCH" />

View File

@ -5344,9 +5344,12 @@ proc rel_sym_path {symbol} {
if { ![string compare $path_elem .] && [info exist curr_dirname]} {
set path_elem $curr_dirname
}
if {![regexp {/$} $path_elem]} {
append path_elem /
}
set pl [string length $path_elem]
if { [string equal -length $pl $path_elem $symbol] } {
set name [string range $symbol [expr {$pl+1}] end]
set name [string range $symbol [expr {$pl}] end]
# When $path_elem is "C:/", string equal will match,
# but $path_elem should not be removed from $name if $name
# has more / for more directory levels.