findsubname(), cleanup

This commit is contained in:
rlar 2017-11-23 17:55:08 +01:00
parent c8340f2b4c
commit 8881aead44
1 changed files with 3 additions and 5 deletions

View File

@ -187,14 +187,12 @@ findsubname(dico_t *dico, SPICE_DSTRINGPTR dstr_p)
} }
if ((p > s) && alfanum(*p)) { /* suppose an identifier */ if ((p > s) && alfanum(*p)) { /* suppose an identifier */
char *t;
entry_t *entry; entry_t *entry;
/* check for known subckt name */ /* check for known subckt name */
spice_dstring_reinit(&name); spice_dstring_reinit(&name);
char *t = s + (int) (p - s - 1) + 1; for (t = p; alfanum(*t); t++)
while (alfanum(s[(t - s)])) { cadd(&name, toupper_c(*t));
cadd(&name, toupper_c(s[(t - s)]));
t++;
}
entry = entrynb(dico, spice_dstring_value(&name)); entry = entrynb(dico, spice_dstring_value(&name));
if (entry && (entry->tp == NUPA_SUBCKT)) { if (entry && (entry->tp == NUPA_SUBCKT)) {
if (h < (int) (ls_ptr - s)) if (h < (int) (ls_ptr - s))