SCP: Ignore trailing whitespace for all commands
This commit is contained in:
parent
ded2b20fe0
commit
b51d250598
2 changed files with 2 additions and 3 deletions
3
scp.c
3
scp.c
|
@ -3291,7 +3291,7 @@ strlcpy (abuf, fcptr, sizeof(abuf));
|
||||||
c = abuf;
|
c = abuf;
|
||||||
do_arg[10] = NULL; /* make sure the argument list always ends with a NULL */
|
do_arg[10] = NULL; /* make sure the argument list always ends with a NULL */
|
||||||
for (nargs = 0; nargs < 10; ) { /* extract arguments */
|
for (nargs = 0; nargs < 10; ) { /* extract arguments */
|
||||||
while (sim_isspace (*c)) /* skip blanks */
|
while (sim_isspace (*c)) /* skip blanks */
|
||||||
c++;
|
c++;
|
||||||
if (*c == 0) /* all done? */
|
if (*c == 0) /* all done? */
|
||||||
do_arg [nargs++] = NULL; /* null argument */
|
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));
|
memmove (cptr, cptr + 3, strlen (cptr + 3));
|
||||||
while (sim_isspace (*cptr)) /* trim leading spc */
|
while (sim_isspace (*cptr)) /* trim leading spc */
|
||||||
cptr++;
|
cptr++;
|
||||||
|
sim_trim_endspc (cptr); /* trim trailing spc */
|
||||||
if ((*cptr == ';') || (*cptr == '#')) { /* ignore comment */
|
if ((*cptr == ';') || (*cptr == '#')) { /* ignore comment */
|
||||||
if (sim_do_echo) /* echo comments if -v */
|
if (sim_do_echo) /* echo comments if -v */
|
||||||
sim_printf("%s> %s\n", do_position(), cptr);
|
sim_printf("%s> %s\n", do_position(), cptr);
|
||||||
|
|
|
@ -1636,8 +1636,6 @@ else {
|
||||||
c = (char)toupper (*tptr++);
|
c = (char)toupper (*tptr++);
|
||||||
if (c == '/') {
|
if (c == '/') {
|
||||||
val2 = strtotv (tptr, &tptr, 10);
|
val2 = strtotv (tptr, &tptr, 10);
|
||||||
while (sim_isspace (*tptr))
|
|
||||||
++tptr;
|
|
||||||
if ((*tptr != '\0') || (val == 0))
|
if ((*tptr != '\0') || (val == 0))
|
||||||
return sim_messagef (SCPE_ARG, "Invalid throttle delay specifier: %s\n", cptr);
|
return sim_messagef (SCPE_ARG, "Invalid throttle delay specifier: %s\n", cptr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue