From 81e1e6fa32bb0db257311de106cc68fc5a370976 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sun, 29 May 2016 00:19:10 +0200 Subject: [PATCH] inp.c, inpcom.c, treat files starting with '*ng_script' as command files --- src/frontend/inp.c | 4 ++++ src/frontend/inpcom.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index f8cea01a8..907fc9a2a 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -334,6 +334,10 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) return; } + /* files starting with *ng_script are user supplied command files */ + if (ciprefix("*ng_script", deck->li_line)) + comfile = TRUE; + if (!comfile) { /* Extract the .option lines from the deck into 'options', and remove them from the deck. */ diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index b8b37e8a8..00f7311be 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -487,6 +487,10 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile) rv = inp_read(fp, 0, dir_name, comfile, intfile); 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 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; } + /* 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) { cc->li_next = xx_new_line(cc->li_next, copy(".global gnd"), 1, 0);