From e71a7374b2116d827fcd4014fa2376fff513d006 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Wed, 6 Mar 2024 01:50:43 +0100 Subject: [PATCH] proc has_included_subcircuit: better filter newlines in `.include file` lines in spice_sym_def attributes --- src/xschem.tcl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/xschem.tcl b/src/xschem.tcl index e68135b3..acccc5d1 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -783,13 +783,14 @@ proc tabulate {text {sep ",\t "}} { proc has_included_subcircuit {symname spice_sym_def} { global has_x set include_found 0 - # puts "has_included_subcircuit: spice_sym_def=$spice_sym_def" regsub -all {\n\+} $spice_sym_def { } spice_sym_def + # puts "has_included_subcircuit: spice_sym_def=$spice_sym_def" set pinlist {} # .include? get the file ... - if {[regexp -nocase {^ *\.include +} $spice_sym_def]} { - regsub -nocase {^ *\.include +} $spice_sym_def {} filename - regsub -all {^"|"$} $filename {} filename + if {[regexp -nocase {^[ \t\n]*\.include +} $spice_sym_def]} { + regsub -nocase {^[ \t\n]*\.include +} $spice_sym_def {} filename + regsub -all {^"|"$} $filename {} filename ;# remove double quotes at beginning and end + regsub -all {^\n*|\n*$} $filename {} filename ;# remove newlines at beginning and end set filename [abs_sym_path $filename] # puts "filename=$filename" set res [catch {open $filename r} fd]