From 8619674d195e2066e1f593c8d840c2506bfcd4d2 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 28 Mar 2012 05:08:39 -0700 Subject: [PATCH] Fixed regression of echo state. Echo is not explicitly inherited by nested do command files. --- scp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scp.c b/scp.c index b2f347e7..c354c05a 100644 --- a/scp.c +++ b/scp.c @@ -985,7 +985,7 @@ t_stat do_cmd (int32 flag, char *fcptr) char *cptr, cbuf[CBUFSIZE], gbuf[CBUFSIZE], *c, quote, *do_arg[10]; FILE *fpin; CTAB *cmdp; -int32 echo = sim_do_echo, nargs, errabort, i; +int32 echo, saved_sim_do_echo = sim_do_echo, nargs, errabort, i; t_bool interactive, isdo, staying; t_stat stat, stat_nomessage; char *ocptr; @@ -996,8 +996,7 @@ interactive = (flag > 0); /* issued interactively? if (interactive) { /* get switches */ GET_SWITCHES (fcptr); } -if (sim_switches & SWMASK ('V')) /* -v means echo */ - echo = 1; +echo = sim_switches & SWMASK ('V'); /* -v means echo */ errabort = sim_switches & SWMASK ('E'); /* -e means abort on error */ @@ -1150,7 +1149,7 @@ do { fclose (fpin); /* close file */ sim_gotofile = NULL; -sim_do_echo = 0; +sim_do_echo = saved_sim_do_echo; /* restore echo state we entered with */ for (i=0; i