From 0579ef7d5190b87df2a1a5d52e32c6b9ceecb14f Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 3 Sep 2017 13:23:50 -0700 Subject: [PATCH] SCP: Allow EXPECT HALTAFTER=n without an expect string to behave as documented --- scp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scp.c b/scp.c index cbee09f7..2a2d2a3c 100644 --- a/scp.c +++ b/scp.c @@ -10413,7 +10413,7 @@ if ((!strncmp(gbuf, "HALTAFTER=", 10)) && (gbuf[10])) { after_set = TRUE; cptr = tptr; } -if ((*cptr != '"') && (*cptr != '\'')) +if ((*cptr != '\0') && (*cptr != '"') && (*cptr != '\'')) return sim_messagef (SCPE_ARG, "String must be quote delimited\n"); cptr = get_glyph_quoted (cptr, gbuf, 0); @@ -10516,6 +10516,11 @@ uint8 *match_buf; uint32 match_size; int i; +/* Hsndle a bare HALTAFTER=nnn command */ +if ((*match == '\0') && (*act == '\0') && after) { + exp->after = after; + return SCPE_OK; + } /* Validate the match string */ match_buf = (uint8 *)calloc (strlen (match) + 1, 1); if (!match_buf)