diff src/octave.cc @ 315:260863721a51

[project @ 1994-01-28 04:22:45 by jwe]
author jwe
date Fri, 28 Jan 1994 04:22:45 +0000
parents 5325afdb0ef5
children 1412ea9fc828
line wrap: on
line diff
--- a/src/octave.cc
+++ b/src/octave.cc
@@ -110,6 +110,9 @@
 // Pointer to function that is currently being evaluated.
 tree_function *curr_function = (tree_function *) NULL;
 
+// Nonzero means input is coming from startup file.
+int input_from_startup_file = 0;
+
 // Top level context (?)
 jmp_buf toplevel;
 
@@ -265,6 +268,11 @@
 static void
 execute_startup_files (void)
 {
+  begin_unwind_frame ("execute_startup_files");
+
+  unwind_protect_int (input_from_startup_file);
+  input_from_startup_file = 1;
+
 // Execute commands from the site-wide configuration file.
 
   char *sd = get_site_defaults ();
@@ -291,6 +299,8 @@
 
   if (home_rc_statbuf.st_ino != dot_rc_statbuf.st_ino)
     parse_and_execute ("./.octaverc", 0);
+
+  run_unwind_frame ("execute_startup_files");
 }
 
 /*
@@ -437,6 +447,12 @@
 
   install_builtins ();
 
+  initialize_readline ();
+
+  initialize_pager ();
+
+  install_signal_handlers ();
+
   if (read_init_files)
     {
       saving_history = 0;
@@ -444,10 +460,6 @@
       saving_history = 1;
     }
 
-  initialize_readline ();
-
-  initialize_pager ();
-
 // Avoid counting commands executed from startup files.
   current_command_number = 1;
 
@@ -491,8 +503,6 @@
   if (! (interactive || forced_interactive))
     using_readline = 0;
 
-  install_signal_handlers ();
-
   if (! inhibit_startup_message)
     {
       cout << "Octave, version " << version_string