From ab5cd17044615c2072e98f037c3650a8e0a77e28 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 19 Apr 2015 17:36:05 +0200 Subject: [PATCH] inpcom.c, workaround for "#307 define problems with the Modelname "mname" with Subcircuits" a diode model named "1smb4148" could not be found because it was dropped in `comment_out_unused_subckt_models()' as a work around the function is_a_modelname() is extended to accept an additional pattern which does match "1smb4148" Thanks to Martin who submitted the bug report here: http://sourceforge.net/p/ngspice/bugs/307/ --- src/frontend/inpcom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 012d39c09..5f3bb6347 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1604,6 +1604,10 @@ is_a_modelname(const char *s) if (isdigit(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isdigit(s[3])) return TRUE; + /* e.g. 1SMB4148 */ + if (isdigit(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isdigit(s[4])) + return TRUE; + return FALSE; }