Revert "re-write inp_rep_ixx(), catch all known cases,"
This reverts commit 55c4f16134.
This commit is contained in:
parent
55c4f16134
commit
a463d0563f
|
|
@ -1762,26 +1762,22 @@ static void inp_rep_ixx(struct card* deck) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char* new_str = NULL;
|
char* new_str = NULL;
|
||||||
bool strsave = FALSE;
|
|
||||||
while (line) {
|
while (line) {
|
||||||
char* s = strstr(line, "i(v");
|
char* s = strstr(line, " i(v");
|
||||||
if (s && (s > line) && (isspace_c(s[-1]) || is_arith_char(s[-1])
|
if (s) {
|
||||||
|| isquote(s[-1]) || (s[-1] == '=') || (s[-1] == '.'))) {
|
|
||||||
char* beg_str, *end_str, *t;
|
char* beg_str, *end_str, *t;
|
||||||
line = s;
|
|
||||||
/* replace i(vxx) by vxx#branch */
|
/* replace i(vxx) by vxx#branch */
|
||||||
if (get_r_paren(&line) == 1) {
|
if (get_r_paren(&line) == 1) {
|
||||||
fprintf(stderr, "Error: missing ')' in line\n %s\n", c->line);
|
fprintf(stderr, "Error: missing ')' in line\n %s\n", c->line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* token containing name of voltage source to be measured */
|
/* token containing name of voltage source to be measured */
|
||||||
t = copy_substring(s + 2, line - 1);
|
t = copy_substring(s + 3, line - 1);
|
||||||
/* change line, convert i(XXX) to XXX#branch */
|
/* change line, convert i(XXX) to XXX#branch */
|
||||||
beg_str = copy_substring(beg, s);
|
beg_str = copy_substring(beg, s);
|
||||||
end_str = copy(line);
|
end_str = copy(line);
|
||||||
tfree(new_str);
|
tfree(new_str);
|
||||||
new_str = tprintf("%s%s%s%s", beg_str, t, "#branch", end_str);
|
new_str = tprintf("%s %s%s %s", beg_str, t, "#branch", end_str);
|
||||||
strsave = TRUE;
|
|
||||||
beg = line = new_str;
|
beg = line = new_str;
|
||||||
tfree(beg_str);
|
tfree(beg_str);
|
||||||
tfree(end_str);
|
tfree(end_str);
|
||||||
|
|
@ -1791,10 +1787,9 @@ static void inp_rep_ixx(struct card* deck) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strsave) {
|
if (new_str) {
|
||||||
tfree(c->line);
|
tfree(c->line);
|
||||||
c->line = new_str;
|
c->line = new_str;
|
||||||
strsave = FALSE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue