diff libinterp/interpfcn/defaults.cc @ 15473:457a2ff2a71b

set Vinfo_file and Vinfo_program variables directly from command line options * octave.cc (octave_process_command_line): Set Vinfo_file and Vinfo_program directly. (octave_initialize_interpreter): Don't call bind_internal_variable to set Vinfo_file or Vinfo_program. * defaults.cc (set_default_info_file): Don't set Vinfo_file unless it is empty. (set_default_info_prog): Don't set Vinfo_program unless it is empty.
author John W. Eaton <jwe@octave.org>
date Wed, 03 Oct 2012 02:17:28 -0400 (2012-10-03)
parents bf0857c789f4
children b1ff8c83e232
line wrap: on
line diff
--- a/libinterp/interpfcn/defaults.cc
+++ b/libinterp/interpfcn/defaults.cc
@@ -316,22 +316,28 @@
 static void
 set_default_info_file (void)
 {
-  std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE);
+  if (Vinfo_file.empty ())
+    {
+      std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE);
 
-  std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE");
+      std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE");
 
-  Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file;
+      Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file;
+    }
 }
 
 static void
 set_default_info_prog (void)
 {
-  std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM");
+  if (Vinfo_program.empty ())
+    {
+      std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM");
 
-  if (oct_info_prog.empty ())
-    Vinfo_program = "info";
-  else
-    Vinfo_program = std::string (oct_info_prog);
+      if (oct_info_prog.empty ())
+        Vinfo_program = "info";
+      else
+        Vinfo_program = std::string (oct_info_prog);
+    }
 }
 
 static void