Mercurial > hg > octave-nkf
changeset 6238:3ecd8d2c5654
[project @ 2007-01-10 21:13:21 by jwe]
author | jwe |
---|---|
date | Wed, 10 Jan 2007 21:13:22 +0000 |
parents | 4a8c7f586ec4 |
children | 82185e38eea8 |
files | src/ChangeLog src/parse.y |
diffstat | 2 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-01-10 Luis F. Ortiz <lortiz@interactivesupercomputing.com> + + * parse.y (load_fcn_from_file): Delete unused variable NAMES. + If NM is absolute, strip directory and extension parts. + 2007-01-10 Michael Goffioul <michael.goffioul@swing.be> * DLD-FUNCTIONS/getrusage.cc: Use #ifdef __WIN32__, not __MINGW32__.
--- a/src/parse.y +++ b/src/parse.y @@ -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 {