findsubckt(), cleanup

This commit is contained in:
rlar 2017-11-18 19:05:51 +01:00
parent 6a9248f111
commit 11adf9f62c
1 changed files with 2 additions and 8 deletions

View File

@ -548,20 +548,14 @@ findsubckt(dico_t *dico, const char * const s)
/* input: s is a subcircuit invocation line.
returns 0 if not found, else the stored definition line number value */
{
const char *name_e = s + strlen(s);
const char *name_b;
const char *name_e = skip_back_ws(s + strlen(s), s);
const char *name_b = skip_back_non_ws(name_e, s);
SPICE_DSTRING ustr; /* u= subckt name is last token in string s */
entry_t *entry; /* symbol table entry */
spice_dstring_init(&ustr);
name_e = skip_back_ws(name_e, s);
name_b = name_e;
name_b = skip_back_non_ws(name_b, s);
pscopy_up(&ustr, name_b, 0, (int) (name_e - name_b));
entry = entrynb(dico, spice_dstring_value(&ustr));