http://d.puremagic.com/issues/show_bug.cgi?id=3355
Summary: std.string.cmp works incorrectly for mixed-type and different-length strings Product: D Version: 2.032 Platform: x86 OS/Version: Linux Status: NEW Keywords: patch Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: acehr...@yahoo.com --- Comment #0 from Ali Cehreli <acehr...@yahoo.com> 2009-10-01 01:08:40 PDT --- cmp fails unit tests when added this one result = cmp("aa", "aaa"d); assert(result < 0); The patch is trivial: 109c109 < if (i1 == s1.length) return s2.length - i2; --- > if (i1 == s1.length) return i2 - s2.length; 136a137,143 > > result = cmp("aa", "aaa"d); > assert(result < 0); > result = cmp("aaa", "aa"d); > assert(result > 0); > result = cmp("aa", "aa"d); > assert(result == 0); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------