# HG changeset patch # User John W. Eaton # Date 1349245048 14400 # Node ID 457a2ff2a71b0bed560c41bf29c96a02c786c238 # Parent c8c828276b69a25b708b75f542998919d80f4a55 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. diff --git a/libinterp/interpfcn/defaults.cc b/libinterp/interpfcn/defaults.cc --- 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 diff --git a/libinterp/octave.cc b/libinterp/octave.cc --- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -52,6 +52,7 @@ #include "display.h" #include "error.h" #include "file-io.h" +#include "help.h" #include "input.h" #include "lex.h" #include "load-path.h" @@ -815,12 +816,12 @@ case INFO_FILE_OPTION: if (optarg) - info_file = optarg; + Vinfo_file = optarg; break; case INFO_PROG_OPTION: if (optarg) - info_program = optarg; + Vinfo_program = optarg; break; case JIT_DEBUG_OPTION: @@ -962,12 +963,6 @@ if (! image_path.empty ()) set_image_path (image_path); - if (! info_file.empty ()) - bind_internal_variable ("info_file", info_file); - - if (! info_program.empty ()) - bind_internal_variable ("info_program", info_program); - if (no_window_system) display_info::no_window_system ();