From b51d250598541dfd41a7afe7b4dd341fb119d837 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 18 May 2018 08:32:03 -0700 Subject: [PATCH] SCP: Ignore trailing whitespace for all commands --- scp.c | 3 ++- sim_timer.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scp.c b/scp.c index 1b28b972..773e6e61 100644 --- a/scp.c +++ b/scp.c @@ -3291,7 +3291,7 @@ strlcpy (abuf, fcptr, sizeof(abuf)); c = abuf; do_arg[10] = NULL; /* make sure the argument list always ends with a NULL */ for (nargs = 0; nargs < 10; ) { /* extract arguments */ - while (sim_isspace (*c)) /* skip blanks */ + while (sim_isspace (*c)) /* skip blanks */ c++; if (*c == 0) /* all done? */ do_arg [nargs++] = NULL; /* null argument */ @@ -8558,6 +8558,7 @@ if (0 == memcmp (cptr, "\xEF\xBB\xBF", 3)) /* Skip/ignore UTF8_BOM memmove (cptr, cptr + 3, strlen (cptr + 3)); while (sim_isspace (*cptr)) /* trim leading spc */ cptr++; +sim_trim_endspc (cptr); /* trim trailing spc */ if ((*cptr == ';') || (*cptr == '#')) { /* ignore comment */ if (sim_do_echo) /* echo comments if -v */ sim_printf("%s> %s\n", do_position(), cptr); diff --git a/sim_timer.c b/sim_timer.c index d83ea210..ae8d77a5 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -1636,8 +1636,6 @@ else { c = (char)toupper (*tptr++); if (c == '/') { val2 = strtotv (tptr, &tptr, 10); - while (sim_isspace (*tptr)) - ++tptr; if ((*tptr != '\0') || (val == 0)) return sim_messagef (SCPE_ARG, "Invalid throttle delay specifier: %s\n", cptr); }