From 00b9fd1ced53b1f111b575d245a3e7f40308ab48 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 14 Apr 2019 16:29:59 +0200 Subject: [PATCH] remove the token mfg=nfgname from each .model statement --- src/frontend/inpcom.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index bf180120e..7fe96e13f 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -133,6 +133,7 @@ static void inp_delete_funcs(struct func_temper *funcs); static bool chk_for_line_continuation(char *line); static void comment_out_unused_subckt_models(struct card *start_card); +static void rem_mfg_from_models(struct card *start_card); static void inp_fix_macro_param_func_paren_io(struct card *begin_card); static void inp_fix_gnd_name(struct card *deck); static void inp_chk_for_multi_in_vcvs(struct card *deck, int *line_number); @@ -613,6 +614,8 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile, bool *expr_w_t if (!has_if) comment_out_unused_subckt_models(working); + rem_mfg_from_models(working); + subckt_params_to_param(working); rv . line_number = inp_split_multi_param_lines(working, rv . line_number); @@ -7766,3 +7769,31 @@ static void inp_check_syntax(struct card *deck) fprintf(cp_err, " This may cause subsequent errors.\n\n"); } } + +/* remove the mfg=mfgname entry from the .model cards */ +static void +rem_mfg_from_models(struct card *deck) +{ + struct card *card; + for (card = deck; card; card = card->nextcard) { + + char *curr_line, *end, *start; + + curr_line = start = card->line; + /* remove mfg=name */ + if (ciprefix(".model", curr_line)){ + start = strstr(curr_line, "mfg="); + if (start) { + end = nexttok(start); + if (*end == '\0') + *start = '\0'; + else + while (start < end) { + *start = ' '; + start++; + } + } + + } + } +} \ No newline at end of file