From 76bf6866489c883f5d018ae22b0ff174d7b7d3fb Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 21 Aug 2020 12:31:30 -0700 Subject: [PATCH] SCP: Restore -D option for TESTLIB command Adding the automatic detach_all ended up always clearing the switches. --- scp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scp.c b/scp.c index c63a856d..c4fab1f9 100644 --- a/scp.c +++ b/scp.c @@ -15509,9 +15509,13 @@ int32 saved_switches = sim_switches & ~SWMASK ('T'); t_stat stat = SCPE_OK; char gbuf[CBUFSIZE]; +GET_SWITCHES (cptr); /* get switches */ +saved_switches |= sim_switches; if (sim_time != 0.0) return sim_messagef (SCPE_UNK, "Library tests can not be performed after instructions have been executed.\n"); +sim_switches = 0; detach_all (0, 0); /* Assure that all units are unattached */ +sim_switches = saved_switches; cptr = get_glyph (cptr, gbuf, 0); if (gbuf[0] == '\0')