changeset 18447:ff7e7928f160 stable

Fix isequal* parse failure when comparing object to non-object (bug #41531). * __isequal__.m: Check varargin is an object before attempting to convert to struct.
author Felipe G. Nievinski <fgnievinski@gmail.com>
date Mon, 10 Feb 2014 13:00:44 -0200
parents 8858d0ccfc93
children 694e8f0b3862
files scripts/general/private/__isequal__.m
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/private/__isequal__.m	Tue Feb 11 14:31:25 2014 -0800
+++ b/scripts/general/private/__isequal__.m	Mon Feb 10 13:00:44 2014 -0200
@@ -82,8 +82,12 @@
   ## From here on, compare objects as if they were structures.
   if (isobject (x))
     x = builtin ("struct", x);
-    varargin = cellfun (@(x) builtin ("struct", x), varargin,
-                        "uniformoutput", false);
+    for i = 1:numel (varargin)
+      if (! isobject (varargin{i}))
+        break;
+      endif
+      varargin{i} = builtin ("struct", varargin{i});
+    endfor
   endif
 
   if (t)