# HG changeset patch # User jwe # Date 760068592 0 # Node ID 2d04965c32fb7e4f640ed687adb70b1c1f987660 # Parent 781f2e2409754d2a5788f0cd6cf347a1dc6f7c8a [project @ 1994-02-01 02:09:52 by jwe] diff --git a/scripts/strings/strcmp.m b/scripts/strings/strcmp.m --- a/scripts/strings/strcmp.m +++ b/scripts/strings/strcmp.m @@ -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