diff src/symtab.h @ 15003:1f5dbfc23fc2

'clear -f' does not work for command line functions (bug #34497) * src/symtab.cc: Added a test case for bug 34497. * src/symtab.h (fcn_info::fcn_info_rep::clear_cmdline_function): Removed method. (fcn_info::fcn_info_rep::clear_user_function): Also clear cmdline function. (fcn_info::fcn_info_rep::clear): Do not call clear_cmdline_function.
author Max Brister <max@2bass.com>
date Mon, 23 Jul 2012 06:53:09 -0500
parents 50e9e02d7c0e
children fabc0e37ead1
line wrap: on
line diff
--- a/src/symtab.h	Sun Jul 22 04:16:02 2012 +0200
+++ b/src/symtab.h	Mon Jul 23 06:53:09 2012 -0500
@@ -768,20 +768,14 @@
           }
       }
 
-      void clear_cmdline_function (void)
-      {
-        if (! cmdline_function.islocked ())
-          cmdline_function = octave_value ();
-      }
-
       void clear_autoload_function (void)
       {
         if (! autoload_function.islocked ())
           autoload_function = octave_value ();
       }
 
-      // FIXME -- should this also clear the cmdline and other "user
-      // defined" functions?
+      // We also clear command line functions here, as these are both
+      // "user defined"
       void clear_user_function (void)
       {
         if (! function_on_path.islocked ())
@@ -790,6 +784,9 @@
 
             function_on_path = octave_value ();
           }
+
+        if (! cmdline_function.islocked ())
+          cmdline_function = octave_value ();
       }
 
       void clear_mex_function (void)
@@ -804,7 +801,6 @@
         clear_unlocked (private_functions);
         clear_unlocked (class_constructors);
         clear_unlocked (class_methods);
-        clear_cmdline_function ();
         clear_autoload_function ();
         clear_user_function ();
       }