Tcl Source Code

Artifact [cff958ec94]
Login

Artifact cff958ec94b688e84ec185daeac6f9ec6bb95d19:

Attachment "1243354.patch" to ticket [1243354fff] added by dgp 2005-07-23 05:26:28.
Index: generic/tclCmdMZ.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdMZ.c,v
retrieving revision 1.127
diff -u -r1.127 tclCmdMZ.c
--- generic/tclCmdMZ.c	17 Jul 2005 21:17:37 -0000	1.127
+++ generic/tclCmdMZ.c	22 Jul 2005 22:24:06 -0000
@@ -1336,7 +1336,7 @@
 	    }
 	}
 
-	if (length1 > 0) {
+	if (length1 >= 0) {
 	    register Tcl_UniChar *p, *end;
 
 	    end = ustring2 + length2 - length1 + 1;
@@ -1344,7 +1344,7 @@
 		/*
 		 * Scan forward to find the first character.
 		 */
-		if ((*p == *ustring1) && (TclUniCharNcmp(ustring1, p,
+		if (/*(*p == *ustring1) &&*/(TclUniCharNcmp(ustring1, p,
 			(unsigned long) length1) == 0)) {
 		    match = p - ustring2;
 		    break;
@@ -1766,13 +1766,13 @@
 	    p = ustring2 + length2 - length1;
 	}
 
-	if (length1 > 0) {
+	if (length1 >= 0) {
 	    for (; p >= ustring2;  p--) {
 		/*
 		 * Scan backwards to find the first character.
 		 */
 
-		if ((*p == *ustring1) &&
+		if (/*(*p == *ustring1) &&*/
 			(memcmp((char *) ustring1, (char *) p, (size_t)
 			    (length1 * sizeof(Tcl_UniChar))) == 0)) {
 		    match = p - ustring2;
Index: tests/string.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/string.test,v
retrieving revision 1.49
diff -u -r1.49 string.test
--- tests/string.test	12 May 2005 22:48:17 -0000	1.49
+++ tests/string.test	22 Jul 2005 22:24:08 -0000
@@ -194,7 +194,7 @@
 } 9
 test string-4.8 {string first} {
     string first "" x123xx345xxx789xxx012
-} -1
+} 0 
 test string-4.9 {string first, unicode} {
     string first x abc\u7266x
 } 4
Index: tests/stringComp.test
===================================================================
RCS file: /cvsroot/tcl/tcl/tests/stringComp.test,v
retrieving revision 1.10
diff -u -r1.10 stringComp.test
--- tests/stringComp.test	10 May 2005 18:35:24 -0000	1.10
+++ tests/stringComp.test	22 Jul 2005 22:24:08 -0000
@@ -250,7 +250,7 @@
 test stringComp-4.8 {string first} {
     proc foo {} {string first "" x123xx345xxx789xxx012}
     foo
-} -1
+} 0
 test stringComp-4.9 {string first, unicode} {
     proc foo {} {string first x abc\u7266x}
     foo