This is a fix to bug report 589 by Bohdan Tkhir:

Remove only mfg=something, icrating=, vceo=, type=,
not any combination of text like net_type=... .
Restrict this removal to compatibility modes ps or lt.
This commit is contained in:
Holger Vogt 2022-06-10 15:35:21 +02:00 committed by DSPOM
parent 17cf791115
commit 22e1af4855
1 changed files with 10 additions and 9 deletions

View File

@ -1050,7 +1050,8 @@ struct card *inp_readall(FILE *fp, const char *dir_name,
inp_rem_unused_models(root, working); inp_rem_unused_models(root, working);
} }
rem_mfg_from_models(working); if (newcompat.lt || newcompat.ps)
rem_mfg_from_models(working);
subckt_params_to_param(working); subckt_params_to_param(working);
@ -9689,8 +9690,8 @@ static void rem_mfg_from_models(struct card *deck)
continue; continue;
/* remove mfg=name */ /* remove mfg=name */
if (ciprefix(".model", curr_line)) { if (ciprefix(".model", curr_line)) {
start = strstr(curr_line, "mfg="); start = search_plain_identifier(curr_line, "mfg");
if (start) { if (start && start[3] == '=') {
end = nexttok(start); end = nexttok(start);
if (*end == '\0') if (*end == '\0')
*start = '\0'; *start = '\0';
@ -9700,8 +9701,8 @@ static void rem_mfg_from_models(struct card *deck)
start++; start++;
} }
} }
start = strstr(curr_line, "icrating="); start = search_plain_identifier(curr_line, "icrating");
if (start) { if (start && start[8] == '=') {
end = nexttok(start); end = nexttok(start);
if (*end == '\0') if (*end == '\0')
*start = '\0'; *start = '\0';
@ -9711,8 +9712,8 @@ static void rem_mfg_from_models(struct card *deck)
start++; start++;
} }
} }
start = strstr(curr_line, "vceo="); start = search_plain_identifier(curr_line, "vceo");
if (start) { if (start && start[4] == '=') {
end = nexttok(start); end = nexttok(start);
if (*end == '\0') if (*end == '\0')
*start = '\0'; *start = '\0';
@ -9722,8 +9723,8 @@ static void rem_mfg_from_models(struct card *deck)
start++; start++;
} }
} }
start = strstr(curr_line, "type="); start = search_plain_identifier(curr_line, "type");
if (start) { if (start && start[4] == '=') {
end = nexttok(start); end = nexttok(start);
if (*end == '\0') if (*end == '\0')
*start = '\0'; *start = '\0';