diff Objects/stringobject.c @ 24918:0d5d8e1cdc22 legacy-trunk

Fix some endcase bugs in unicode rfind()/rindex() and endswith(). These were reported and fixed by Inyeol Lee in SF bug 595350. The endswith() bug was already fixed in 2.3, but this adds some more test cases.
author Guido van Rossum <guido@python.org>
date Tue, 20 Aug 2002 17:29:29 +0000
parents bc660f73795c
children 762dd09edb83
line wrap: on
line diff
--- a/Objects/stringobject.c	Tue Aug 20 15:43:16 2002 +0000
+++ b/Objects/stringobject.c	Tue Aug 20 17:29:29 2002 +0000
@@ -1536,7 +1536,7 @@
 	}
 #ifdef Py_USING_UNICODE
 	else if (PyUnicode_Check(subobj))
-		return PyUnicode_Find((PyObject *)self, subobj, i, last, 1);
+		return PyUnicode_Find((PyObject *)self, subobj, i, last, dir);
 #endif
 	else if (PyObject_AsCharBuffer(subobj, &sub, &n))
 		return -2;