From 6cfd55180fa4bfb75559013cd5b071d6c99e3eb8 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 7 Jan 2021 17:12:06 -0800 Subject: [PATCH] SCP: Assure proper goto and call behavior with spaces in path names --- scp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scp.c b/scp.c index 7627b016..462eae36 100644 --- a/scp.c +++ b/scp.c @@ -5288,7 +5288,10 @@ const char *cptr; if (NULL == sim_gotofile) return SCPE_UNK; /* only valid inside of do_cmd */ cptr = get_glyph (fcptr, gbuf, 0); 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 */ return do_cmd_label (flag, cbuf, gbuf); }