inp.c, inpcom.c, treat files starting with '*ng_script' as command files

This commit is contained in:
h_vogt 2016-05-29 00:19:10 +02:00 committed by rlar
parent c505cb820d
commit fc6edd8669
2 changed files with 12 additions and 0 deletions

View File

@ -334,6 +334,10 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
return; return;
} }
/* files starting with *ng_script are user supplied command files */
if (ciprefix("*ng_script", deck->li_line))
comfile = TRUE;
if (!comfile) { if (!comfile) {
/* Extract the .option lines from the deck into 'options', /* Extract the .option lines from the deck into 'options',
and remove them from the deck. */ and remove them from the deck. */

View File

@ -487,6 +487,10 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile)
rv = inp_read(fp, 0, dir_name, comfile, intfile); rv = inp_read(fp, 0, dir_name, comfile, intfile);
cc = rv . cc; cc = rv . cc;
/* files starting with *ng_script are user supplied command files */
if (cc && ciprefix("*ng_script", cc->li_line))
comfile = TRUE;
/* The following processing of an input file is not required for command files /* The following processing of an input file is not required for command files
like spinit or .spiceinit, so return command files here. */ like spinit or .spiceinit, so return command files here. */
@ -895,6 +899,10 @@ inp_read(FILE *fp, int call_depth, char *dir_name, bool comfile, bool intfile)
return rv; return rv;
} }
/* files starting with *ng_script are user supplied command files */
if (call_depth == 0 && ciprefix("*ng_script", cc->li_line))
comfile = TRUE;
if (call_depth == 0 && !comfile) { if (call_depth == 0 && !comfile) {
cc->li_next = xx_new_line(cc->li_next, copy(".global gnd"), 1, 0); cc->li_next = xx_new_line(cc->li_next, copy(".global gnd"), 1, 0);