From b7bd59c22cb67f59156d65e6982942369968e567 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 24 Nov 2019 12:40:28 +0100 Subject: [PATCH 1/3] On Linux: allow calling gnuplot without invoking a terminal. Reported by Terry Pilling --- src/frontend/plotting/gnuplot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 2d5220d03..57811e243 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -94,6 +94,8 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab terminal_type = 4; if (cieq(terminal, "eps/quit")) terminal_type = 5; + if (cieq(terminal, "xterm")) + terminal_type = 6; } if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0)) @@ -342,8 +344,10 @@ ft_gnuplot(double *xlims, double *ylims, char *filename, char *title, char *xlab fprintf(cp_out, "writing plot to file %s.eps\n", filename); (void) sprintf(buf, "gnuplot %s", filename_plt); } - else + else if (terminal_type == 6) (void) sprintf(buf, "xterm -e gnuplot %s - &", filename_plt); + else + (void) sprintf(buf, "gnuplot -p %s - &", filename_plt); #endif err = system(buf); From 78c4a51d2a5bcd28563615300bf24b2d53e69daf Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 27 Nov 2019 00:31:24 +0100 Subject: [PATCH 2/3] allow 'dc TEMP 10 20 1' as well as 'dc temp 10 20 1' --- src/spicelib/analysis/dctrcurv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index 1e25baca2..c373160a7 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -140,7 +140,7 @@ DCtrCurv(CKTcircuit *ckt, int restart) } } - if (!strcmp(job->TRCVvName[i], "temp")) { + if (cieq(job->TRCVvName[i], "temp")) { job->TRCVvSave[i] = ckt->CKTtemp; /* Saves the old circuit temperature */ job->TRCVvType[i] = TEMP_CODE; /* Set the sweep type code */ ckt->CKTtemp = job->TRCVvStart[i] + CONSTCtoK; /* Set the new circuit temp */ From 9a77d224448b68f28e250cda2c047340851bcb53 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 27 Nov 2019 23:31:22 +0100 Subject: [PATCH 3/3] prevent crash if 0 length vector is assessed --- src/spicelib/devices/vsrc/vsrcask.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spicelib/devices/vsrc/vsrcask.c b/src/spicelib/devices/vsrc/vsrcask.c index bdf922c46..752fdc688 100644 --- a/src/spicelib/devices/vsrc/vsrcask.c +++ b/src/spicelib/devices/vsrc/vsrcask.c @@ -92,7 +92,10 @@ VSRCask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue * strcpy(errMsg,msg); return(E_ASKCURRENT); } else { - value->rValue = *(ckt->CKTrhsOld+here->VSRCbranch); + if (ckt->CKTrhsOld) + value->rValue = *(ckt->CKTrhsOld + here->VSRCbranch); + else + value->rValue = 0.; } return(OK); case VSRC_POWER: