Mercurial > hg > octave-lyh
diff src/parse.y @ 6238:3ecd8d2c5654
[project @ 2007-01-10 21:13:21 by jwe]
author | jwe |
---|---|
date | Wed, 10 Jan 2007 21:13:22 +0000 |
parents | 9ff5a6936031 |
children | ea65de49e18e |
line wrap: on
line diff
--- 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 {