diff --git a/src/frontend/inp.c b/src/frontend/inp.c index bf775f1c1..b0e989838 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -569,7 +569,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) if (!comfile) { /* Extract the .option lines from the deck into 'options', - and remove them from the deck. */ + and remove them from the deck. Exceptions are .option with params. */ options = inp_getopts(deck); /* Check for .option seed=[val|random] and set the random number generator. Check for .option cshunt=val and set a global variable cshunt_value */ diff --git a/src/frontend/options.c b/src/frontend/options.c index 6ea3a9f37..0a17714a5 100644 --- a/src/frontend/options.c +++ b/src/frontend/options.c @@ -214,7 +214,6 @@ cp_usrvars(void) /* Extract the .option lines from the deck */ - struct card * inp_getopts(struct card *deck) { @@ -222,7 +221,9 @@ inp_getopts(struct card *deck) for (dd = deck->nextcard; dd; dd = next) { next = dd->nextcard; - if (ciprefix(".opt", dd->line)) { + /* .option with params is excluded here. These options will be handled + after parameter substitution by INP2dot(), dot_options(), and INPdoOpts(). */ + if (ciprefix(".opt", dd->line) && !strchr(dd->line, '{')) { inp_casefix(dd->line); if (last) last->nextcard = dd->nextcard;