mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
SCP: Properly report errors in malformed SET ENV -P commands
This commit is contained in:
parent
52817a58b9
commit
857934d40e
4
scp.c
4
scp.c
@ -5091,10 +5091,14 @@ if (sim_switches & SWMASK ('P')) {
|
||||
if (prompt[0] == '\0')
|
||||
return sim_messagef (SCPE_2FARG, "Missing Prompt and Environment Variable Name\n");
|
||||
if ((prompt[0] == '"') || (prompt[0] == '\'')) {
|
||||
if (strlen (prompt) < 3)
|
||||
return sim_messagef (SCPE_ARG, "Invalid Prompt\n");
|
||||
prompt[strlen (prompt) - 1] = '\0';
|
||||
memmove (prompt, prompt + 1, strlen (prompt));
|
||||
}
|
||||
deflt = get_glyph (cptr, varname, '='); /* get environment variable name */
|
||||
if (varname[0] == '\0')
|
||||
return sim_messagef (SCPE_2FARG, "Missing Environment Variable Name\n");
|
||||
if (deflt == NULL)
|
||||
deflt = "";
|
||||
if (*deflt) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user