SCP: Fix EXPECT regular expression match environment variable names

- Use sim_messagef for consistency
This commit is contained in:
Mark Pizzolato 2018-09-27 06:24:31 -07:00
parent 9414b6b98e
commit 928193d463
3 changed files with 13 additions and 12 deletions

Binary file not shown.

15
scp.c
View file

@ -1963,7 +1963,7 @@ static const char simh_help[] =
" If the expect rule was a regular expression rule, then the environment\n"
" variable _EXPECT_MATCH_GROUP_0 is set to the whole string which matched\n"
" and if the match pattern had any parentheses delimited sub-groups, the\n"
" environment variables _EXPECT_MATCH_PATTERN_1 thru _EXPECT_MATCH_PATTERN_n\n"
" environment variables _EXPECT_MATCH_GROUP_1 thru _EXPECT_MATCH_GROUP_n\n"
" are set to the values within the string which matched the respective\n"
" sub-groups.\n"
/***************** 80 character line width template *************************/
@ -3144,7 +3144,7 @@ t_stat help_cmd (int32 flag, CONST char *cptr)
char gbuf[CBUFSIZE];
CTAB *cmdp;
GET_SWITCHES (cptr);
GET_SWITCHES (cptr); /* get switches */
if (sim_switches & SWMASK ('F'))
flag = flag | SCP_HELP_FLAT;
if (*cptr) {
@ -3322,7 +3322,7 @@ uint8 dbuf[4*CBUFSIZE];
uint32 dsize = 0;
t_stat r;
GET_SWITCHES (cptr);
GET_SWITCHES (cptr); /* get switches */
tptr = get_glyph (cptr, gbuf, ',');
if (sim_isalpha(gbuf[0]) && (strchr (gbuf, ':'))) {
r = tmxr_locate_line (gbuf, &lp);
@ -6645,8 +6645,8 @@ t_stat reset_cmd (int32 flag, CONST char *cptr)
char gbuf[CBUFSIZE];
DEVICE *dptr;
GET_SWITCHES (cptr); /* get switches */
run_cmd_did_reset = FALSE;
GET_SWITCHES (cptr); /* get switches */
if (*cptr == 0) /* reset(cr) */
return (reset_all (0));
cptr = get_glyph (cptr, gbuf, 0); /* get next glyph */
@ -7895,7 +7895,6 @@ fflush(stdout); /* flush stdout */
if (sim_log) /* flush log if enabled */
fflush (sim_log);
sim_throt_sched (); /* set throttle */
sim_rtcn_init_all (); /* re-init clocks */
sim_start_timer_services (); /* enable wall clock timing */
do {
@ -8790,7 +8789,7 @@ DEVICE *dptr = sim_dflt_dev;
int32 i, rdx, a, lim;
t_stat r;
GET_SWITCHES (cptr);
GET_SWITCHES (cptr); /* get switches */
GET_RADIX (rdx, dptr->dradix);
for (i = 0; i < sim_emax; i++)
sim_eval[i] = 0;
@ -14333,11 +14332,13 @@ if (isalpha (*data) || (*data == '_')) {
if (rptr) {
*svalue = (t_svalue)get_rval (rptr, 0);
sprint_val (string, *svalue, 10, string_size - 1, PV_LEFTSIGN);
sim_debug (SIM_DBG_EXP_EVAL, sim_dflt_dev, "[Value: %s=%s]\n", data, string);
return TRUE;
}
gptr = _sim_get_env_special (data, string, string_size - 1);
if (gptr) {
*svalue = strtotsv(string, &gptr, 0);
sim_debug (SIM_DBG_EXP_EVAL, sim_dflt_dev, "[Value: %s=%s]\n", data, string);
return ((*gptr == '\0') && (*string));
}
else {
@ -14352,10 +14353,12 @@ if ((data[0] == '"') && (data_size > 1) && (data[data_size - 1] == '"'))
strlcpy (string, data, string_size);
if (string[0] == '\0') {
*svalue = strtotsv(data, &gptr, 0);
sim_debug (SIM_DBG_EXP_EVAL, sim_dflt_dev, "[Value: %s=%s]\n", data, string);
return ((*gptr == '\0') && (*data));
}
sim_sub_args (string, string_size, sim_exp_argv);
*svalue = strtotsv(string, &gptr, 0);
sim_debug (SIM_DBG_EXP_EVAL, sim_dflt_dev, "[Value: %s=%s]\n", data, string);
return ((*gptr == '\0') && (*string));
}

View file

@ -1178,12 +1178,10 @@ if ((Scb.scb_w_cluster != Home.hm2_w_cluster) ||
(Scb.scb_b_strucver != Home.hm2_b_strucver) ||
(Scb.scb_b_struclev != Home.hm2_b_struclev))
goto Return_Cleanup;
if (!sim_quiet) {
sim_printf ("%s%d: '%s' Contains ODS%d File system\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename, Home.hm2_b_struclev);
sim_printf ("%s%d: Volume Name: %12.12s ", sim_dname (dptr), (int)(uptr-dptr->units), Home.hm2_t_volname);
sim_printf ("Format: %12.12s ", Home.hm2_t_format);
sim_printf ("Sectors In Volume: %u\n", Scb.scb_l_volsize);
}
sim_messagef (SCPE_OK, "%s%d: '%s' Contains ODS%d File system\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename, Home.hm2_b_struclev);
sim_messagef (SCPE_OK, "%s%d: Volume Name: %12.12s ", sim_dname (dptr), (int)(uptr-dptr->units), Home.hm2_t_volname);
sim_messagef (SCPE_OK, "Format: %12.12s ", Home.hm2_t_format);
sim_messagef (SCPE_OK, "Sectors In Volume: %u\n", Scb.scb_l_volsize);
ret_val = ((t_offset)Scb.scb_l_volsize) * 512;
Return_Cleanup: