From 2b43b358a8da95f6a47881f09fabbad9911d3270 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 20 Mar 2012 11:16:41 -0700 Subject: [PATCH] Fix SHOW SHOW command to separate the SHOW options which are device specific and unit specific --- scp.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/scp.c b/scp.c index 1da280dc..59344e72 100644 --- a/scp.c +++ b/scp.c @@ -2159,21 +2159,39 @@ return SCPE_OK; t_stat show_dev_show_commands (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, char *cptr) { -int32 any, enb; +int32 any = 0; MTAB *mptr; -any = enb = 0; if (dptr->modifiers) { + any = 0; for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) { if ((!mptr->disp) || (!mptr->pstring)) continue; + if (('\0' == *mptr->pstring) || + (0 == (mptr->mask & MTAB_XTD)) || + (0 == (mptr->mask & MTAB_VDV))) /* Device Option */ + continue; if (any++) fprintf (st, ", %s", mptr->pstring); else fprintf (st, "sh{ow} %s\t%s", sim_dname (dptr), mptr->pstring); } + if (any) + fprintf (st, "\n"); + any = 0; + for (mptr = dptr->modifiers; mptr->mask != 0; mptr++) { + if ((!mptr->disp) || (!mptr->pstring)) + continue; + if (('\0' == *mptr->pstring) || + (0 == (mptr->mask & MTAB_XTD)) || + (0 == (mptr->mask & MTAB_VUN))) /* Unit Option */ + continue; + if (any++) + fprintf (st, ", %s", mptr->pstring); + else fprintf (st, "sh{ow} %sn\t%s", sim_dname (dptr), mptr->pstring); + } + if (any) + fprintf (st, "\n"); } -if (any) - fprintf (st, "\n"); return SCPE_OK; }