changeset 321:2d04965c32fb

[project @ 1994-02-01 02:09:52 by jwe]
author jwe
date Tue, 01 Feb 1994 02:09:52 +0000
parents 781f2e240975
children d93ab6bf48d7
files scripts/strings/strcmp.m
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/strings/strcmp.m	Fri Jan 28 20:01:18 1994 +0000
+++ b/scripts/strings/strcmp.m	Tue Feb 01 02:09:52 1994 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1993 John W. Eaton
+# Copyright (C) 1993, 1994 John W. Eaton
 # 
 # This file is part of Octave.
 # 
@@ -31,11 +31,19 @@
   endif
 
   status = 0;
-  if (isstr (s1) && isstr(s2) && length (s1) == length (s2))
-    tmp = implicit_str_to_num_ok;
-    implicit_str_to_num_ok = "true";
-    status = all (s1 == s2);
-    implicit_str_to_num_ok = tmp;
+  if (isstr (s1) && isstr(s2))
+    len_s1 = columns (s1);
+    len_s2 = columns (s2);
+    if (len_s1 == len_s2)
+      if (len_s1 == 0)
+        status = 1;
+      else
+        tmp = implicit_str_to_num_ok;
+        implicit_str_to_num_ok = "true";
+        status = all (s1 == s2);
+        implicit_str_to_num_ok = tmp;
+      endif
+    endif
   endif
 
 endfunction