From 01ed224896a7532f269a91be5787e6d607acc3f3 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Wed, 20 Oct 2021 22:16:36 +0200 Subject: [PATCH] A check to avoid multiple entries for the same node into the .save list Scan the data base dbs (list of saves) before a new entry is generated. --- src/frontend/breakp2.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/frontend/breakp2.c b/src/frontend/breakp2.c index 56cc9f463..217d6c0be 100644 --- a/src/frontend/breakp2.c +++ b/src/frontend/breakp2.c @@ -48,7 +48,7 @@ com_save2(wordlist *wl, char *name) void settrace(wordlist *wl, int what, char *name) { - struct dbcomm *d, *last; + struct dbcomm *d, *last, *dbcheck; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -101,6 +101,15 @@ settrace(wordlist *wl, int what, char *name) /* wrd_chtrace(s, TRUE, what); */ } + /* Don't save a nodename more than once */ + 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)) { + goto loopend; + } + } + } + d = TMALLOC(struct dbcomm, 1); d->db_analysis = name; d->db_type = db_type; @@ -113,6 +122,8 @@ settrace(wordlist *wl, int what, char *name) ft_curckt->ci_dbs = dbs = d; last = d; + + loopend:; } }