# HG changeset patch # User jwe # Date 1168463602 0 # Node ID 3ecd8d2c5654931683b973728e5e89b4e4eb2323 # Parent 4a8c7f586ec44cedfb2ba8928eb276699fbefc04 [project @ 2007-01-10 21:13:21 by jwe] diff -r 4a8c7f586ec4 -r 3ecd8d2c5654 src/ChangeLog --- a/src/ChangeLog Wed Jan 10 19:20:10 2007 +0000 +++ b/src/ChangeLog Wed Jan 10 21:13:22 2007 +0000 @@ -1,3 +1,8 @@ +2007-01-10 Luis F. Ortiz + + * parse.y (load_fcn_from_file): Delete unused variable NAMES. + If NM is absolute, strip directory and extension parts. + 2007-01-10 Michael Goffioul * DLD-FUNCTIONS/getrusage.cc: Use #ifdef __WIN32__, not __MINGW32__. diff -r 4a8c7f586ec4 -r 3ecd8d2c5654 src/parse.y --- a/src/parse.y Wed Jan 10 19:20:10 2007 +0000 +++ b/src/parse.y Wed Jan 10 21:13:22 2007 +0000 @@ -3399,15 +3399,15 @@ } bool -load_fcn_from_file (const std::string& nm, bool exec_script) +load_fcn_from_file (const std::string& nm_arg, bool exec_script) { unwind_protect::begin_frame ("load_fcn_from_file"); bool script_file_executed = false; - string_vector names (2); - - int nm_len = nm.length (); + std::string nm = nm_arg; + + size_t nm_len = nm.length (); std::string file; @@ -3417,6 +3417,9 @@ || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) { file = nm; + + nm = octave_env::base_pathname (file); + nm = nm.substr (0, nm.find_last_of ('.')); } else {