]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix stupid bug in strip and split
authorGuido van Rossum <guido@python.org>
Tue, 14 Feb 1995 00:58:59 +0000 (00:58 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Feb 1995 00:58:59 +0000 (00:58 +0000)
Modules/stropmodule.c

index 90ee4fd166c8b2cb7f7ccb4dda468c4d8a1ab144..4e9d0ee60f0fcca8e4b4b22425af814ca374a51c 100644 (file)
@@ -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) {