SCP: Fix ON ERROR default declaration
- Additionally, be sure that ON actions are saved with unexpanded variables As reported #681
This commit is contained in:
parent
0c39921fb7
commit
8d172a4049
1 changed files with 2 additions and 2 deletions
4
scp.c
4
scp.c
|
@ -4941,12 +4941,12 @@ else {
|
|||
return sim_messagef (SCPE_ARG, "Invalid argument: %s\n", gbuf);
|
||||
}
|
||||
}
|
||||
if (cond == SCPE_OK)
|
||||
return sim_messagef (SCPE_ARG, "Invalid argument: %s\n", gbuf);
|
||||
if ((NULL == cptr) || ('\0' == *cptr)) { /* Empty Action */
|
||||
free(sim_on_actions[sim_do_depth][cond]); /* Clear existing condition */
|
||||
sim_on_actions[sim_do_depth][cond] = NULL; }
|
||||
else {
|
||||
if ((cptr > sim_sub_instr_buf) && ((size_t)(cptr - sim_sub_instr_buf) < sim_sub_instr_size))
|
||||
cptr = &sim_sub_instr[sim_sub_instr_off[cptr - sim_sub_instr_buf]]; /* get un-substituted string */
|
||||
sim_on_actions[sim_do_depth][cond] =
|
||||
(char *)realloc(sim_on_actions[sim_do_depth][cond], 1+strlen(cptr));
|
||||
strcpy(sim_on_actions[sim_do_depth][cond], cptr);
|
||||
|
|
Loading…
Add table
Reference in a new issue