From: Guido van Rossum Date: Tue, 14 Feb 1995 00:58:59 +0000 (+0000) Subject: fix stupid bug in strip and split X-Git-Tag: v1.2b3~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee1813de2adf255406a4b201af0f3a10c0c84e1f;p=thirdparty%2FPython%2Fcpython.git fix stupid bug in strip and split --- diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 90ee4fd166c8..4e9d0ee60f0f 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -55,7 +55,7 @@ strop_split(self, args) i = i+1; } j = i; - while (i < len && isspace(Py_CHARMASK(s[i]))) { + while (i < len && !isspace(Py_CHARMASK(s[i]))) { i = i+1; } if (j < i) { @@ -278,7 +278,7 @@ strop_strip(self, args) j = len; do { j--; - } while (j >= i && isspace(Py_CHARMASK(s[i]))); + } while (j >= i && isspace(Py_CHARMASK(s[j]))); j++; if (i == 0 && j == len) {