Mercurial > hg > octave-jordi
comparison 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 |
parents | bf0857c789f4 |
children | b1ff8c83e232 |
comparison
equal
deleted
inserted
replaced
15472:c8c828276b69 | 15473:457a2ff2a71b |
---|---|
314 } | 314 } |
315 | 315 |
316 static void | 316 static void |
317 set_default_info_file (void) | 317 set_default_info_file (void) |
318 { | 318 { |
319 std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE); | 319 if (Vinfo_file.empty ()) |
320 | 320 { |
321 std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE"); | 321 std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE); |
322 | 322 |
323 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file; | 323 std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE"); |
324 | |
325 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file; | |
326 } | |
324 } | 327 } |
325 | 328 |
326 static void | 329 static void |
327 set_default_info_prog (void) | 330 set_default_info_prog (void) |
328 { | 331 { |
329 std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM"); | 332 if (Vinfo_program.empty ()) |
330 | 333 { |
331 if (oct_info_prog.empty ()) | 334 std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM"); |
332 Vinfo_program = "info"; | 335 |
333 else | 336 if (oct_info_prog.empty ()) |
334 Vinfo_program = std::string (oct_info_prog); | 337 Vinfo_program = "info"; |
338 else | |
339 Vinfo_program = std::string (oct_info_prog); | |
340 } | |
335 } | 341 } |
336 | 342 |
337 static void | 343 static void |
338 set_default_editor (void) | 344 set_default_editor (void) |
339 { | 345 { |