Mercurial > hg > octave-lojdl
changeset 1516:14d8c0a838c1
[project @ 1995-10-03 13:21:12 by jwe]
author | jwe |
---|---|
date | Tue, 03 Oct 1995 13:22:22 +0000 |
parents | d361954e95ae |
children | 5a02b9fba19e |
files | src/octave.cc src/toplev.h src/variables.cc |
diffstat | 3 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/octave.cc +++ b/src/octave.cc @@ -135,6 +135,10 @@ // The command-line options. Octave_str_obj octave_argv; +// Nonzero means that input is coming from a file that was named on +// the command line. +int input_from_command_line_file = 1; + // Top level context (?) jmp_buf toplevel; @@ -314,10 +318,12 @@ unwind_protect_int (echo_input); unwind_protect_int (using_readline); unwind_protect_int (saving_history); + unwind_protect_int (input_from_command_line_file); echo_input = 0; using_readline = 0; saving_history = 0; + input_from_command_line_file = 0; unwind_protect_ptr (curr_sym_tab); @@ -663,6 +669,8 @@ if (infile) { + input_from_command_line_file = 1; + bind_builtin_variable ("program_invocation_name", curr_fcn_file_name); @@ -896,10 +904,12 @@ begin_unwind_frame ("eval_string"); unwind_protect_int (get_input_from_eval_string); + unwind_protect_int (input_from_command_line_file); unwind_protect_ptr (global_command); unwind_protect_ptr (current_eval_string); get_input_from_eval_string = 1; + input_from_command_line_file = 0; current_eval_string = string; YY_BUFFER_STATE old_buf = current_buffer ();
--- a/src/toplev.h +++ b/src/toplev.h @@ -90,6 +90,10 @@ // The command-line options. extern Octave_str_obj octave_argv; +// Nonzero means that input is coming from a file that was named on +// the command line. +extern int input_from_command_line_file; + #endif /*
--- a/src/variables.cc +++ b/src/variables.cc @@ -706,10 +706,12 @@ unwind_protect_int (echo_input); unwind_protect_int (saving_history); unwind_protect_int (reading_fcn_file); + unwind_protect_int (input_from_command_line_file); echo_input = 0; saving_history = 0; reading_fcn_file = 1; + input_from_command_line_file = 0; YY_BUFFER_STATE old_buf = current_buffer (); YY_BUFFER_STATE new_buf = create_buffer (ffile);