From 31b9075f88c465ceffafdd31d77ac103a291b5c5 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 27 Oct 2024 15:18:34 +0100 Subject: [PATCH] If preprocessing is skipped, we still need the number of lines in the deck. --- src/frontend/inpcom.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5cab2a48b..e3863cb50 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1050,9 +1050,15 @@ struct card *inp_readall(FILE *fp, const char *dir_name, const char* file_name, rv = inp_read(fp, 0, dir_name, file_name, comfile, intfile); cc = rv.cc; - /* skip all pre-processing for expanded input files created by 'listing r' */ - if (cc && ciprefix("* expanded deck of", cc->line)) + /* skip all pre-processing for expanded input files created by 'listing r', + but evaluate number of lines in input deck */ + if (cc && ciprefix("* expanded deck of", cc->line)) { + struct card* dd; + dynmaxline = 0; + for (dd = cc; dd; dd = dd->nextcard) + dynmaxline++; return cc; + } /* files starting with *ng_script are user supplied command files */ if (cc && ciprefix("*ng_script", cc->line))