Fix crash when a "*ng_script_with_params" script is called

from a control section.
This commit is contained in:
Giles Atkinson 2026-03-15 18:47:25 +00:00
parent fe8193cdfb
commit 3586cbcbea
1 changed files with 2 additions and 2 deletions

View File

@ -502,6 +502,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
* intfile = whether input is from internal array. Values are TRUE/FALSE
*/
{
extern char **Copy_of_argv; // main.c
struct card *deck = NULL, *dd, *ld, *prev_param = NULL, *prev_card = NULL;
struct card *realdeck = NULL, *options = NULL, *curr_meas = NULL;
char *tt = NULL, name[BSIZE_SP + 1], *s, *t, *temperature = NULL;
@ -645,8 +646,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
bool with_params = FALSE;
#ifndef SHARED_MODULE
if (ciprefix("*ng_script_with_params", deck->line)) {
extern char **Copy_of_argv; // main.c
if (Copy_of_argv && ciprefix("*ng_script_with_params", deck->line)) {
extern int optind; // Library function getopt()
static const char header[] = "argc = %u argv = ( ";
wordlist *setarg;