# HG changeset patch # User jwe # Date 1145029058 0 # Node ID 0163e7d6916156cfc3a1449253b9da88cee44bab # Parent f78d64fbe5907dd47fb543e2b3016dd2d038396a [project @ 2006-04-14 15:37:38 by jwe] diff -r f78d64fbe590 -r 0163e7d69161 scripts/ChangeLog --- a/scripts/ChangeLog Fri Apr 14 04:47:21 2006 +0000 +++ b/scripts/ChangeLog Fri Apr 14 15:37:38 2006 +0000 @@ -1,3 +1,8 @@ +2006-04-14 Bill Denney + + * strings/strcmpi.m: Return false instead of error if args are not + char or cellstr. + 2006-04-10 John W. Eaton * miscellaneous/dir.m: Ensure that returned structure array is diff -r f78d64fbe590 -r 0163e7d69161 scripts/strings/strcmpi.m --- a/scripts/strings/strcmpi.m Fri Apr 14 04:47:21 2006 +0000 +++ b/scripts/strings/strcmpi.m Fri Apr 14 15:37:38 2006 +0000 @@ -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