# HG changeset patch # User John W. Eaton # Date 1287735851 14400 # Node ID a51ac4198e1c4e59c2a34acabec8cbe38374f55e # Parent 047b0e877a14971005cf05c1e8bd10145ff23ac9 oct-parse.yy (load_fcn_from_file): also strip directory when computing function name from filename diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-10-22 John W. Eaton + + * oct-parse.yy (load_fcn_from_file): Also strip directory when + computing function name from filename. Bug #31395. + 2010-10-21 Gunnar Farnebäck * mex.cc (mxArray_number::as_octave_value): Convert single diff --git a/src/oct-parse.yy b/src/oct-parse.yy --- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -3721,6 +3721,10 @@ { nm = octave_env::base_pathname (file); nm = nm.substr (0, nm.find_last_of ('.')); + + size_t pos = nm.find_last_of (file_ops::dir_sep_str ()); + if (pos != std::string::npos) + nm = nm.substr (pos+1pp); } if (autoload)