From 74b32f392c0caf96d767ac5e7049cfa9f9e8c1cb Mon Sep 17 00:00:00 2001 From: h_vogt Date: Fri, 10 Jan 2014 21:23:28 +0100 Subject: [PATCH] inpcom.c: E, G source, improved search for 'vol' and 'cur' in response to a bug report by Marlize Schoeman "#274 VCVS Exxxx name and node names do not allow VOL as text" http://sourceforge.net/p/ngspice/bugs/274/ --- src/frontend/inpcom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 1fad39e2f..37ae3f4b2 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -4416,7 +4416,8 @@ inp_compat(struct line *card) Exxx n1 n2 int1 0 1 BExxx int1 0 V = {equation} */ - if ((str_ptr = strstr(curr_line, "vol")) != NULL) { + /* search for ' vol=' or ' vol =' */ + if (((str_ptr = strchr(curr_line, '=')) != NULL) && prefix("vol", skip_back_non_ws(skip_back_ws(str_ptr)))) { cut_line = curr_line; /* title and nodes */ title_tok = gettok(&cut_line); @@ -4614,7 +4615,8 @@ inp_compat(struct line *card) Gxxx n1 n2 int1 0 1 BGxxx int1 0 V = {equation} */ - if ((str_ptr = strstr(curr_line, "cur")) != NULL) { + /* search for ' cur=' or ' cur =' */ + if (((str_ptr = strchr(curr_line, '=')) != NULL) && prefix("cur", skip_back_non_ws(skip_back_ws(str_ptr)))) { char *m_ptr, *m_token; cut_line = curr_line; /* title and nodes */