SCP: Assure proper goto and call behavior with spaces in path names

This commit is contained in:
Mark Pizzolato 2021-01-07 17:12:06 -08:00
parent 186fa30f37
commit 6cfd55180f

5
scp.c
View file

@ -5288,7 +5288,10 @@ const char *cptr;
if (NULL == sim_gotofile) return SCPE_UNK; /* only valid inside of do_cmd */ if (NULL == sim_gotofile) return SCPE_UNK; /* only valid inside of do_cmd */
cptr = get_glyph (fcptr, gbuf, 0); cptr = get_glyph (fcptr, gbuf, 0);
if ('\0' == gbuf[0]) return SCPE_ARG; /* unspecified goto target */ if ('\0' == gbuf[0]) return SCPE_ARG; /* unspecified goto target */
snprintf (cbuf, sizeof (cbuf), "%s %s", sim_do_filename[sim_do_depth], cptr); snprintf (cbuf, sizeof (cbuf), "%s%s%s %s", (NULL != strchr (sim_do_filename[sim_do_depth], ' ')) ? "\"" : "",
sim_do_filename[sim_do_depth],
(NULL != strchr (sim_do_filename[sim_do_depth], ' ')) ? "\"" : "",
cptr);
sim_switches |= SWMASK ('O'); /* inherit ON state and actions */ sim_switches |= SWMASK ('O'); /* inherit ON state and actions */
return do_cmd_label (flag, cbuf, gbuf); return do_cmd_label (flag, cbuf, gbuf);
} }