From ab6e65507dec1c3654c987ec19530b69c6a92a0a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 6 Nov 2022 13:01:11 -1000 Subject: [PATCH] SCP: Allow MTAB show routines to cleanly output nothing and be well formatted Merely returning a non SCPE_OK status indicates no output and thus no comma or newline separation. --- scp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 9cf8ce66..e71fe1bb 100644 --- a/scp.c +++ b/scp.c @@ -7390,9 +7390,9 @@ for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) { ((mptr->mask & MTAB_XTD)? (MODMASK(mptr,flag) && !MODMASK(mptr,MTAB_NMO)): ((MTAB_VUN == (uint32)flag) && ((uptr->flags & mptr->mask) == mptr->match)))) { - if (*toks > 2) { + if ((*toks > 2) && (r == SCPE_OK)) {/* something emitted already? */ fprintf (st, "\n"); - *toks = 0; + *toks = 0; /* force device/unit name indent on next output */ } if (r == SCPE_OK) fprint_sep (st, toks, flag);