aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-07-12 23:20:39 -0700
committerArnold D. Robbins <arnold@skeeve.com>2014-07-12 23:20:39 -0700
commitde3372f0d98c7137823e7d5630d03429bb77d1f2 (patch)
tree389fa3f5f107b3ca1178e6d7a65e66ff3644e29c /debug.c
parentebb6772e9eabeb81e3cc9305a6bec7adf7aad450 (diff)
parentdf2eaea6a92c7d89d604d0a4e885d064678ce3ed (diff)
downloadegawk-de3372f0d98c7137823e7d5630d03429bb77d1f2.tar.gz
egawk-de3372f0d98c7137823e7d5630d03429bb77d1f2.tar.bz2
egawk-de3372f0d98c7137823e7d5630d03429bb77d1f2.zip
Merge branch 'master' into comment
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/debug.c b/debug.c
index c4c48154..58012b72 100644
--- a/debug.c
+++ b/debug.c
@@ -2801,7 +2801,7 @@ debug_prog(INSTRUCTION *pc)
unserialize(OPTION);
unsetenv("DGAWK_RESTART");
fprintf(out_fp, "Restarting ...\n");
- if (run[0] == 'T')
+ if (strcasecmp(run, "true") == 0)
(void) do_run(NULL, 0);
} else if (command_file != NULL) {
@@ -5449,6 +5449,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
int ecount = 0, pcount = 0;
int ret;
int save_flags = do_flags;
+ SRCFILE *the_source;
if (prog_running) {
this_frame = find_frame(0);
@@ -5459,7 +5460,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
ctxt = new_context();
ctxt->install_func = append_symbol; /* keep track of newly installed globals */
push_context(ctxt);
- (void) add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL);
+ the_source = add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL);
do_flags = false;
ret = parse_program(&code);
do_flags = save_flags;
@@ -5560,14 +5561,27 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
this_func->param_cnt -= ecount;
}
- /* always destroy symbol "@eval", however destroy all newly installed
+ /*
+ * Always destroy symbol "@eval", however destroy all newly installed
* globals only if fatal error (execute_code() returing NULL).
*/
pop_context(); /* switch to prev context */
free_context(ctxt, (ret_val != NULL)); /* free all instructions and optionally symbols */
- if (ret_val != NULL)
- destroy_symbol(f); /* destroy "@eval" */
+
+ if (ret_val != NULL) {
+ /*
+ * Remove @eval from FUNCTAB, so that above code
+ * will work the next time around.
+ */
+ NODE *s = make_string("@eval", 5);
+
+ (void) assoc_remove(func_table, s);
+ unref(s);
+ }
+
+ free_srcfile(the_source);
+
return false;
}