diff scripts/strings/strcmpi.m @ 5762:0163e7d69161

[project @ 2006-04-14 15:37:38 by jwe]
author jwe
date Fri, 14 Apr 2006 15:37:38 +0000
parents 9c9eac3a6513
children 34f96dd5441b
line wrap: on
line diff
--- a/scripts/strings/strcmpi.m
+++ b/scripts/strings/strcmpi.m
@@ -40,9 +40,13 @@
 function retval = strcmpi (s1, s2)
 
   if (nargin == 2)
-    ## Note that we don't use tolower here because we need to be able to
-    ## handle cell arrays of strings.
-    retval = strcmp (lower (s1), lower (s2));
+    if ((ischar(s1) || iscellstr(s1)) && (ischar(s2) || iscellstr(s2)))
+      ## Note that we don't use tolower here because we need to be able
+      ## to handle cell arrays of strings.
+      retval = strcmp (lower (s1), lower (s2));
+    else
+      retval = false;
+    endif
   else
     usage ("strcmpi (s1, s2)");
   endif