SCP: Allow EXPECT HALTAFTER=n without an expect string to behave as documented

This commit is contained in:
Mark Pizzolato 2017-09-03 13:23:50 -07:00
parent 769efb1f68
commit 0579ef7d51

7
scp.c
View file

@ -10413,7 +10413,7 @@ if ((!strncmp(gbuf, "HALTAFTER=", 10)) && (gbuf[10])) {
after_set = TRUE; after_set = TRUE;
cptr = tptr; cptr = tptr;
} }
if ((*cptr != '"') && (*cptr != '\'')) if ((*cptr != '\0') && (*cptr != '"') && (*cptr != '\''))
return sim_messagef (SCPE_ARG, "String must be quote delimited\n"); return sim_messagef (SCPE_ARG, "String must be quote delimited\n");
cptr = get_glyph_quoted (cptr, gbuf, 0); cptr = get_glyph_quoted (cptr, gbuf, 0);
@ -10516,6 +10516,11 @@ uint8 *match_buf;
uint32 match_size; uint32 match_size;
int i; int i;
/* Hsndle a bare HALTAFTER=nnn command */
if ((*match == '\0') && (*act == '\0') && after) {
exp->after = after;
return SCPE_OK;
}
/* Validate the match string */ /* Validate the match string */
match_buf = (uint8 *)calloc (strlen (match) + 1, 1); match_buf = (uint8 *)calloc (strlen (match) + 1, 1);
if (!match_buf) if (!match_buf)