diff --git a/ext2spice/ext2spice.c b/ext2spice/ext2spice.c index 8205abfd..aa0ecc29 100644 --- a/ext2spice/ext2spice.c +++ b/ext2spice/ext2spice.c @@ -661,7 +661,9 @@ CmdExtToSpice(w, cmd) case EXTTOSPC_DEFAULT: LocCapThreshold = 2; LocResistThreshold = INFINITE_THRESHOLD; - EFOutputFlags = EF_CONVERTCOMMA | EF_CONVERTEQUAL; + /* Clear EFOutputFlags but preserve "short" behavior */ + EFOutputFlags &= ~EF_TRIM_MASK; + EFOutputFlags |= EF_CONVERTCOMMA | EF_CONVERTEQUAL; EFScale = 0.0; if (EFArgTech) { @@ -1440,7 +1442,8 @@ subcktVisit(use, hierName, is_top) else { int savflags = EFOutputFlags; - EFOutputFlags = EF_CONVERTCOMMA; // Only substitute commas on subcircuit names + EFOutputFlags &= ~EF_TRIM_MASK; + EFOutputFlags |= EF_CONVERTCOMMA; // Only substitute commas on subcircuit names /* Use full hierarchical decomposition for name */ /* (not just use->use_id. hierName already has use->use_id at end) */ @@ -3499,7 +3502,7 @@ EFHNSprintf(str, hierName) s = str; if (hierName->hn_parent) str = efHNSprintfPrefix(hierName->hn_parent, str); - if (EFOutputFlags) + if (EFOutputFlags & EF_TRIM_MASK) { cp = hierName->hn_name; trimGlob = (EFOutputFlags & EF_TRIMGLOB); diff --git a/extflat/extflat.h b/extflat/extflat.h index 3ae5bb37..6e710ea9 100644 --- a/extflat/extflat.h +++ b/extflat/extflat.h @@ -38,16 +38,17 @@ typedef unsigned char U_char; /* with the same name. */ /* Flags to control output of node names. Stored in EFOutputFlags */ +#define EF_TRIM_MASK 0x1f /* Mask for handling name trimming */ #define EF_TRIMGLOB 0x01 /* Delete trailing '!' from names */ #define EF_TRIMLOCAL 0x02 /* Delete trailing '#' from names */ #define EF_CONVERTCOMMA 0x04 /* Change ',' to '|' in names, else remove */ #define EF_CONVERTEQUAL 0x08 /* Change '=' to ':' in names, else remove */ #define EF_CONVERTBRACKETS 0x10 /* Change '[' and ']' to '_' in names */ -#define EF_SHORT_MASK 0x30 /* Mask for handling port shorts */ +#define EF_SHORT_MASK 0x60 /* Mask for handling port shorts */ #define EF_SHORT_NONE 0x00 /* Shorted ports are merged */ -#define EF_SHORT_R 0x10 /* Shorted ports separated with 0 ohm resistor */ -#define EF_SHORT_V 0x20 /* Shorted ports separated with 0 volt source */ +#define EF_SHORT_R 0x20 /* Shorted ports separated with 0 ohm resistor */ +#define EF_SHORT_V 0x40 /* Shorted ports separated with 0 volt source */ /* * capacitance type now set to float