Mercurial > hg > octave-lyh
changeset 10446:ba932ad87a04
load_path::add_to_fcn_map: style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 24 Mar 2010 09:53:14 -0400 |
parents | 62f8ae5ab2cc |
children | 12d25a1d84bf |
files | src/ChangeLog src/load-path.cc |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-03-24 John W. Eaton <jwe@octave.org> + + * load-path.cc (load_path::add_to_fcn_map): Style fixes. + 2010-03-24 Jaroslav Hajek <highegg@gmail.com> * variables.cc (maybe_missing_function_hook): Don't call hook if
--- a/src/load-path.cc +++ b/src/load-path.cc @@ -1688,13 +1688,20 @@ else { // Warn if a built-in or library function is being shadowed. + if (! file_info_list.empty ()) { file_info& old = file_info_list.front (); - if (sys_path.find (old.dir_name) != std::string::npos) - if (in_path_list (sys_path, old.dir_name)) + + // FIXME -- do we need to be more careful about the + // way we look for old.dir_name in sys_path to avoid + // partial matches? + + if (sys_path.find (old.dir_name) != std::string::npos + && in_path_list (sys_path, old.dir_name)) { std::string fcn_path = file_ops::concat (dir_name, fname); + warning_with_id ("Octave:shadowed-function", "function %s shadows a core library function", fcn_path.c_str ());