From 97008025a9efc8f2172e43be118f6670588e2512 Mon Sep 17 00:00:00 2001 From: joncham Date: Tue, 6 Oct 2009 15:14:12 +0000 Subject: [PATCH] 2009-10-06 Jonathan Chambers * String.cs (Contains): Use CompareOptions.Ordinal. Fixes bug #535425. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@143519 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/corlib/System/ChangeLog | 5 +++++ class/corlib/System/String.cs | 2 +- class/corlib/Test/System/ChangeLog | 6 ++++++ class/corlib/Test/System/StringTest.cs | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/class/corlib/System/ChangeLog b/class/corlib/System/ChangeLog index 108a7bdb79..bd06999c78 100644 --- a/class/corlib/System/ChangeLog +++ b/class/corlib/System/ChangeLog @@ -1,3 +1,8 @@ +2009-10-06 Jonathan Chambers + + * String.cs (Contains): Use CompareOptions.Ordinal. Fixes bug + #535425. + 2009-10-04 Mark Probst * AppDomain.cs: Check for static AppDomainInitializer earlier to diff --git a/class/corlib/System/String.cs b/class/corlib/System/String.cs index b0cef03cd3..ecc35b32f4 100644 --- a/class/corlib/System/String.cs +++ b/class/corlib/System/String.cs @@ -1194,7 +1194,7 @@ namespace System return 0; if (this.length == 0) return -1; - return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, 0, length); + return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, 0, length, CompareOptions.Ordinal); } public int IndexOf (String value, int startIndex) diff --git a/class/corlib/Test/System/ChangeLog b/class/corlib/Test/System/ChangeLog index 7da8d0d545..c29ad8ea2c 100644 --- a/class/corlib/Test/System/ChangeLog +++ b/class/corlib/Test/System/ChangeLog @@ -1,3 +1,9 @@ +2009-10-06 Jonathan Chambers + + * StringTest.cs (Contains): Add test for Contains using + an Ordinal compare. Bug #535425. + + 2009-09-24 Zoltan Varga * TypeTest.cs: Add a test for missing. diff --git a/class/corlib/Test/System/StringTest.cs b/class/corlib/Test/System/StringTest.cs index 20047644be..355e7e4b77 100644 --- a/class/corlib/Test/System/StringTest.cs +++ b/class/corlib/Test/System/StringTest.cs @@ -2283,6 +2283,7 @@ public class StringTest Assert.IsTrue ("ABC".Contains ("ABC")); Assert.IsTrue ("ABC".Contains ("AB")); Assert.IsTrue (!"ABC".Contains ("AD")); + Assert.IsTrue (!"encyclopædia".Contains("encyclopaedia")); } [Test] -- 2.11.4.GIT