diff src/ov-fcn-handle.cc @ 6481:89ed13fec6fe

[project @ 2007-04-03 19:39:11 by jwe]
author jwe
date Tue, 03 Apr 2007 19:39:12 +0000
parents 59a4304b7cc5
children 5d02dfacfc9e
line wrap: on
line diff
--- a/src/ov-fcn-handle.cc
+++ b/src/ov-fcn-handle.cc
@@ -614,7 +614,17 @@
 
   octave_function *fcn = octave_call_stack::current ();
 
-  octave_value f = lookup_function (nm, fcn ? fcn->name () : std::string ());
+  std::string parent_name = fcn ? fcn->name () : std::string ();
+
+  if (! parent_name.empty ())
+    {
+      size_t pos = parent_name.find (':');
+
+      if (pos != NPOS)
+	parent_name = parent_name.substr (0, pos);
+    }
+
+  octave_value f = lookup_function (nm, parent_name);
 
   if (f.is_function ())
     retval = octave_value (new octave_fcn_handle (f, nm));