# HG changeset patch # User John W. Eaton # Date 1345763254 14400 # Node ID 2d337a9869e9fab0c048cfbd292f94193e25e7c9 # Parent a44e4a08fc55098d96489354f98cbe5808d05fdb correctly handle multiple --path command line arguments * octave.cc (command_line_path): Now a list of strings. (octave_process_command_line): Append --path args to command_line_path list. (octave_initialize_interpreter): Call load_path::set_command_line_path on each element of commnad_line_path list. diff -r a44e4a08fc55 -r 2d337a9869e9 libinterp/octave.cc --- a/libinterp/octave.cc Thu Aug 23 17:53:42 2012 -0400 +++ b/libinterp/octave.cc Thu Aug 23 19:07:34 2012 -0400 @@ -138,7 +138,7 @@ // The value of "path" specified on the command line. // (--path; -p) -static std::string command_line_path; +static std::list command_line_path; // Flags used to determine what commands should be echoed when they are // parsed and executed. @@ -758,7 +758,7 @@ case 'p': if (optarg) - command_line_path = optarg; + command_line_path.push_back (optarg); break; case 'q': @@ -931,8 +931,9 @@ if (! read_history_file) bind_internal_variable ("saving_history", false); - if (! command_line_path.empty ()) - load_path::set_command_line_path (command_line_path); + for (std::list::const_iterator it = command_line_path.begin (); + it != command_line_path.end (); it++) + load_path::set_command_line_path (*it); if (echo_executing_commands) bind_internal_variable ("echo_executing_commands",