From 5e73be130a9aaeed596b9f2e8d79648da51b1a72 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 4 Jun 2023 14:53:38 +0200 Subject: [PATCH] Allow ';' also at the beginning of a line. --- src/frontend/inpcom.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index d9d927bae..a4b157de3 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -8349,14 +8349,14 @@ static void inp_check_syntax(struct card *deck) if (*cut_line == '*' || *cut_line == '\0') continue; // check for unusable leading characters and change them to '*' - if (strchr("=[]?()&%$\"!:,\f;", *cut_line)) { + if (strchr("=[]?()&%$\"!:,\f", *cut_line)) { if (ft_stricterror) { fprintf(stderr, "Error: '%c' is not allowed as first character in line %s.\n", *cut_line, cut_line); controlled_exit(EXIT_BAD); } else { if (!check_ch) { - fprintf(stderr, "Warning: Unusual leading characters like '%c' or others out of '= [] ? () & %% $\"!:,;\\f'\n", *cut_line); + fprintf(stderr, "Warning: Unusual leading characters like '%c' or others out of '= [] ? () & %% $\"!:,\\f'\n", *cut_line); fprintf(stderr, " in netlist or included files, will be replaced with '*'.\n"); fprintf(stderr, " Check line no %d: %s\n\n", card->linenum_orig, cut_line); check_ch = 1; /* just one warning */ @@ -8364,6 +8364,10 @@ static void inp_check_syntax(struct card *deck) *cut_line = '*'; } } + /* leading end-of-line delimiter ';' silently change to '*' */ + else if (*cut_line == ';') { + *cut_line = '*'; + } // check for .control ... .endc if (ciprefix(".control", cut_line)) { if (check_control > 0) {