From 6037450952a5a13f6fec86178f7fe3977305a295 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 20 Sep 2022 20:09:42 +0200 Subject: [PATCH] Warning message, when 'run' is called without job (tran, op, ac etc.) is defined. --- src/frontend/runcoms.c | 6 ++++++ src/frontend/spiceif.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/frontend/runcoms.c b/src/frontend/runcoms.c index 8ea318bf9..e23623373 100644 --- a/src/frontend/runcoms.c +++ b/src/frontend/runcoms.c @@ -349,6 +349,12 @@ static int dosim( err = 1; cp_vset("sim_status", CP_NUM, &err); } + else if (err == 3) { + fprintf(cp_err, "%s simulation not started\n", what); + ft_curckt->ci_inprogress = FALSE; + err = 1; + cp_vset("sim_status", CP_NUM, &err); + } else { ft_curckt->ci_inprogress = FALSE; } diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 075a51034..4277c4917 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -330,6 +330,11 @@ if_run(CKTcircuit *ckt, char *what, wordlist *args, INPtables *tab) if (eq(what, "run")) { ft_curckt->ci_curTask = ft_curckt->ci_defTask; ft_curckt->ci_curOpt = ft_curckt->ci_defOpt; + if (ft_curckt->ci_curTask->jobs == NULL) { + /* nothing to 'run' */ + fprintf(stderr, "Warning: No job (tran, ac, op etc.) defined:\n"); + return (3); + } } /* -- Find out what we are supposed to do. */