Jelajahi Sumber

* regex.cs: In Split(), if the last match is at the end of the string,
an empty string must be added to the array of results.

svn path=/trunk/mcs/; revision=21825

Lluis Sanchez 22 tahun lalu
induk
melakukan
266c78e7de

+ 5 - 0
mcs/class/System/System.Text.RegularExpressions/ChangeLog

@@ -1,3 +1,8 @@
+2004-01-07  Lluis Sanchez Gual <[email protected]>
+
+	* regex.cs: In Split(), if the last match is at the end of the string, 
+	an empty string must be added to the array of results.
+
 2003-12-15  Sanjay Gupta <[email protected]>
 	* match.cs: Check for null value before Substring method call.  
 	Fixes bug #52034.

+ 1 - 1
mcs/class/System/System.Text.RegularExpressions/regex.cs

@@ -337,7 +337,7 @@ namespace System.Text.RegularExpressions {
 				ptr = m.Index + m.Length;
 			}
 
-			if (ptr < input.Length) {
+			if (ptr <= input.Length) {
 				splits.Add (input.Substring (ptr));
 			}