Fix crash when a "*ng_script_with_params" script is called
from a control section.
This commit is contained in:
parent
fe8193cdfb
commit
3586cbcbea
|
|
@ -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
|
* 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 *deck = NULL, *dd, *ld, *prev_param = NULL, *prev_card = NULL;
|
||||||
struct card *realdeck = NULL, *options = NULL, *curr_meas = NULL;
|
struct card *realdeck = NULL, *options = NULL, *curr_meas = NULL;
|
||||||
char *tt = NULL, name[BSIZE_SP + 1], *s, *t, *temperature = 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;
|
bool with_params = FALSE;
|
||||||
|
|
||||||
#ifndef SHARED_MODULE
|
#ifndef SHARED_MODULE
|
||||||
if (ciprefix("*ng_script_with_params", deck->line)) {
|
if (Copy_of_argv && ciprefix("*ng_script_with_params", deck->line)) {
|
||||||
extern char **Copy_of_argv; // main.c
|
|
||||||
extern int optind; // Library function getopt()
|
extern int optind; // Library function getopt()
|
||||||
static const char header[] = "argc = %u argv = ( ";
|
static const char header[] = "argc = %u argv = ( ";
|
||||||
wordlist *setarg;
|
wordlist *setarg;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue