Fixed #1969: split and rsplit in bytearray are inconsistent

This commit is contained in:
Christian Heimes 2008-01-30 09:51:48 +00:00
parent d4cb56d4e8
commit 7b876158dc
3 changed files with 15 additions and 4 deletions

View file

@ -2388,16 +2388,16 @@ rsplit_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
for (i = j = len - 1; i >= 0; ) {
/* find a token */
while (i >= 0 && Py_UNICODE_ISSPACE(s[i]))
while (i >= 0 && ISSPACE(s[i]))
i--;
j = i;
while (i >= 0 && !Py_UNICODE_ISSPACE(s[i]))
while (i >= 0 && !ISSPACE(s[i]))
i--;
if (j > i) {
if (maxcount-- <= 0)
break;
SPLIT_ADD(s, i + 1, j + 1);
while (i >= 0 && Py_UNICODE_ISSPACE(s[i]))
while (i >= 0 && ISSPACE(s[i]))
i--;
j = i;
}