From db8ec9baf4e316785fedcf68c48055a32181206a Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 27 Jul 2025 16:38:16 +0200 Subject: [PATCH 1/3] Don't print a form feed if 'option nopage' is given. Print the header really only once if 'option nopage' is given. --- src/frontend/postcoms.c | 41 ++++++++++++++++++++-------------- tests/sensitivity/diffpair.cir | 2 +- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index a19160ae9..ec280138e 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -122,7 +122,7 @@ void com_print(wordlist *wl) { struct dvec *v, *lv = NULL, *bv, *nv, *vecs = NULL; - int i, j, ll, width = DEF_WIDTH, height = DEF_HEIGHT, npoints, lineno; + int i, j, ll, width = DEF_WIDTH, height = DEF_HEIGHT, npoints, lineno, npages = 0; struct pnode *pn, *names; struct plot *p; bool col = TRUE, nobreak = FALSE, noprintscale, plotnames = FALSE; @@ -292,6 +292,7 @@ com_print(wordlist *wl) noprintscale = cp_getvar("noprintscale", CP_BOOL, NULL, 0); bv = vecs; nextpage: + npages++; /* Make the first vector of every page be the scale... */ /* XXX But what if there is no scale? e.g. op, pz */ if (!noprintscale && bv->v_plot->pl_ndims) @@ -313,21 +314,24 @@ com_print(wordlist *wl) break; } - /* Print the header on the first page only. */ - p = bv->v_plot; - j = (width - (int) strlen(p->pl_title)) / 2; /* Yes, keep "(int)" */ - if (j < 0) - j = 0; - for (i = 0; i < j; i++) - buf2[i] = ' '; - buf2[j] = '\0'; - out_send(buf2); - out_send(p->pl_title); - out_send("\n"); - out_send(buf2); - (void) sprintf(buf, "%s %s", p->pl_name, p->pl_date); - out_send(buf); - out_send("\n"); + /* Print the header on the first page only, if 'option nopage'. */ + if (!ft_nopage || npages == 1) { + /* print the header */ + p = bv->v_plot; + j = (width - (int)strlen(p->pl_title)) / 2; /* Yes, keep "(int)" */ + if (j < 0) + j = 0; + for (i = 0; i < j; i++) + buf2[i] = ' '; + buf2[j] = '\0'; + out_send(buf2); + out_send(p->pl_title); + out_send("\n"); + out_send(buf2); + (void)sprintf(buf, "%s %s", p->pl_name, p->pl_date); + out_send(buf); + out_send("\n"); + } for (i = 0; i < width; i++) buf2[i] = '-'; buf2[width] = '\n'; @@ -403,7 +407,10 @@ com_print(wordlist *wl) goto done; if (j == npoints) { /* More vectors to print. */ bv = lv; - out_send("\f\n"); /* Form feed. */ + if(nobreak) + out_send("\n"); /* return without form feed. */ + else + out_send("\f\n"); /* Form feed. */ goto nextpage; } diff --git a/tests/sensitivity/diffpair.cir b/tests/sensitivity/diffpair.cir index ddd1b8ef7..9e9206f30 100644 --- a/tests/sensitivity/diffpair.cir +++ b/tests/sensitivity/diffpair.cir @@ -21,7 +21,7 @@ vdm 1 11 dc 0 sin(0 0.1 5meg) ac 1 vcc 8 0 12 vee 9 0 -12 -.options noacct +.options noacct nopage * Analyses: .tf v(5) vcm From 955b379932c6b268aa16c7d059133db994a6007c Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 27 Jul 2025 16:39:00 +0200 Subject: [PATCH 2/3] Don't check .params as they will fall through anyway. --- src/spicelib/parser/inp2dot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spicelib/parser/inp2dot.c b/src/spicelib/parser/inp2dot.c index 7c871cc66..ba8c9e5e8 100644 --- a/src/spicelib/parser/inp2dot.c +++ b/src/spicelib/parser/inp2dot.c @@ -838,6 +838,10 @@ INP2dot(CKTcircuit *ckt, INPtables *tab, struct card *current, TSKtask *task, CK /* don't have to do anything, since models were all done in * pass 1 */ goto quit; + } else if (strcmp(token, ".param") == 0) { + /* don't have to do anything, since params were all done + * elsewhere */ + goto quit; } else if ((strcmp(token, ".width") == 0) || strcmp(token, ".print") == 0 || strcmp(token, ".plot") == 0) { /* obsolete - ignore */ From 3230f5c740106826155635b51d331aca8b289eba Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 27 Jul 2025 16:40:55 +0200 Subject: [PATCH 3/3] Keep saving nodes only once, but make an exception for node 'all'. Fixes bug-799, at least partially (diffpair.cir is running again.). --- src/frontend/breakp2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/breakp2.c b/src/frontend/breakp2.c index 8e2748a68..5a0e1856f 100644 --- a/src/frontend/breakp2.c +++ b/src/frontend/breakp2.c @@ -92,10 +92,11 @@ settrace(wordlist *wl, int what, char *name) continue; } - /* Don't save a nodename more than once */ + /* Don't save a nodename more than once, except for token 'all' */ if (db_type == DB_SAVE) { for (dbcheck = dbs; dbcheck; dbcheck = dbcheck->db_next) { - if (dbcheck->db_type == DB_SAVE && eq(dbcheck->db_nodename1, db_nodename1)) { + if (dbcheck->db_type == DB_SAVE && eq(dbcheck->db_nodename1, db_nodename1) && + !eq("all", db_nodename1)) { tfree(db_nodename1); goto loopend; }