Mercurial > hg > octave-nkf
changeset 4993:761b8d760785
[project @ 2004-09-15 18:28:56 by jwe]
author | jwe |
---|---|
date | Wed, 15 Sep 2004 18:28:56 +0000 |
parents | 2f2afb8635f5 |
children | 48d0defe9445 |
files | scripts/ChangeLog scripts/strings/strcmp.m |
diffstat | 2 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,6 +1,8 @@ 2004-09-15 John W. Eaton <jwe@octave.org> * strings/strcmp.m: Fix typo in cell/string array case. + Use iscellstr to check for cells rather than iscell. + Improve diagnostics for invalid args. 2004-09-10 David Bateman <dbateman@free.fr>
--- a/scripts/strings/strcmp.m +++ b/scripts/strings/strcmp.m @@ -47,7 +47,7 @@ retval = all (all (s1 == s2)); endif endif - elseif (iscell (s2)) + elseif (iscellstr (s2)) [r2, c2] = size (s2); if (r1 == 1) t2 = s2(:); @@ -77,7 +77,7 @@ endif endif endif - elseif (iscell (s1)) + elseif (iscellstr (s1)) [r1, c1] = size (s1); if (isstr (s2)) [r2, c2] = size (s2); @@ -108,7 +108,7 @@ endif endif endif - elseif (iscell (s2)) + elseif (iscellstr (s2)) [r2, c2] = size (s2); if (r1 == 1 && c1 == 1) t1 = s1{:}; @@ -139,7 +139,11 @@ else error ("strcmp: nonconformant cell arrays"); endif + else + error ("strcmp: expecting args to be strings or cell arrays of strings"); endif + else + error ("strcmp: expecting args to be strings or cell arrays of strings"); endif endfunction