]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Robin Becker: The following patch seems to fix a module case bug in
authorGuido van Rossum <guido@python.org>
Mon, 1 May 2000 17:36:58 +0000 (17:36 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 1 May 2000 17:36:58 +0000 (17:36 +0000)
1.6a2 caused by wrong return values in routine allcaps83.  [GvR: I
also changed the case for end-s>8 to return 0.]

Python/import.c

index c3f890bf98120d1fb66fbe0763838915501f7b14..f33f9a1bb90e8e93c02814bf180a4128d10d3490 100644 (file)
@@ -1035,15 +1035,15 @@ allcaps8x3(s)
        char *end = strchr(s, '\0');
        if (dot != NULL) {
                if (dot-s > 8)
-                       return 1; /* More than 8 before '.' */
+                       return 0; /* More than 8 before '.' */
                if (end-dot > 4)
-                       return 1; /* More than 3 after '.' */
+                       return 0; /* More than 3 after '.' */
                end = strchr(dot+1, '.');
                if (end != NULL)
-                       return 1; /* More than one dot  */
+                       return 0; /* More than one dot  */
        }
        else if (end-s > 8)
-               return 1; /* More than 8 and no dot */
+               return 0; /* More than 8 and no dot */
        while ((c = *s++)) {
                if (islower(c))
                        return 0;