# HG changeset patch # User jwe # Date 812726542 0 # Node ID 14d8c0a838c11b1c3535fd2bd18f223816c78be3 # Parent d361954e95ae3316c23725fc3de33811e7b74a05 [project @ 1995-10-03 13:21:12 by jwe] diff -r d361954e95ae -r 14d8c0a838c1 src/octave.cc --- a/src/octave.cc Tue Oct 03 13:18:11 1995 +0000 +++ b/src/octave.cc Tue Oct 03 13:22:22 1995 +0000 @@ -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 (); diff -r d361954e95ae -r 14d8c0a838c1 src/toplev.h --- a/src/toplev.h Tue Oct 03 13:18:11 1995 +0000 +++ b/src/toplev.h Tue Oct 03 13:22:22 1995 +0000 @@ -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 /* diff -r d361954e95ae -r 14d8c0a838c1 src/variables.cc --- a/src/variables.cc Tue Oct 03 13:18:11 1995 +0000 +++ b/src/variables.cc Tue Oct 03 13:22:22 1995 +0000 @@ -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);