# HG changeset patch # User jwe # Date 751008479 0 # Node ID a500c60e8f2351daee62bf1474978acc228d2df5 # Parent 43074bfdc8c5ef2ef9ed78a5b10381bead60ebe1 [project @ 1993-10-19 05:24:44 by jwe] diff -r 43074bfdc8c5 -r a500c60e8f23 src/oct-hist.cc --- a/src/oct-hist.cc Tue Oct 19 05:14:27 1993 +0000 +++ b/src/oct-hist.cc Tue Oct 19 05:27:59 1993 +0000 @@ -58,6 +58,9 @@ #include } +// Nonzero means input is coming from temporary history file. +int input_from_tmp_history_file = 0; + // Nonzero means we are saving history lines. int saving_history = 1; @@ -512,7 +515,7 @@ file.close (); - return name; + return strsave (name); } void @@ -569,7 +572,9 @@ begin_unwind_frame ("do_edit_history"); unwind_protect_int (echo_input); + unwind_protect_int (input_from_tmp_history_file); echo_input = 1; + input_from_tmp_history_file = 1; parse_and_execute (name, 1); @@ -579,6 +584,8 @@ // unwind_protect. unlink (name); + + delete [] name; } void @@ -593,7 +600,9 @@ begin_unwind_frame ("do_run_history"); unwind_protect_int (echo_input); + unwind_protect_int (input_from_tmp_history_file); echo_input = 1; + input_from_tmp_history_file = 1; parse_and_execute (name, 1); @@ -603,6 +612,8 @@ // unwind_protect. unlink (name); + + delete [] name; } int diff -r 43074bfdc8c5 -r a500c60e8f23 src/oct-hist.h --- a/src/oct-hist.h Tue Oct 19 05:14:27 1993 +0000 +++ b/src/oct-hist.h Tue Oct 19 05:27:59 1993 +0000 @@ -36,6 +36,9 @@ extern void do_run_history (int, char**); extern int current_history_number (void); +// Nonzero means input is coming from temporary history file. +extern int input_from_tmp_history_file; + // Nonzero means we are saving history lines. extern int saving_history; diff -r 43074bfdc8c5 -r a500c60e8f23 src/parse.y --- a/src/parse.y Tue Oct 19 05:14:27 1993 +0000 +++ b/src/parse.y Tue Oct 19 05:27:59 1993 +0000 @@ -34,6 +34,7 @@ #include "error.h" #include "variables.h" +#include "octave-hist.h" #include "user-prefs.h" #include "input.h" #include "utils.h" @@ -486,7 +487,7 @@ (sr, $1->line (), $1->column ()); tree_simple_assignment_expression *expr = new tree_simple_assignment_expression - (id, $3, $2->line () , $2->column ()); + (id, $3, $2->line (), $2->column ()); expr->eval (0); } | global_decl1 optcomma NAME @@ -908,7 +909,8 @@ } else { - if (reading_script_file + if (! input_from_tmp_history_file + && reading_script_file && strcmp (curr_m_file_name, id_name) == 0) warning ("function `%s' defined within\ script file `%s.m'", id_name, curr_m_file_name);