mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
Robin Becker: The following patch seems to fix a module case bug in
1.6a2 caused by wrong return values in routine allcaps83. [GvR: I also changed the case for end-s>8 to return 0.]
This commit is contained in:
parent
93a8eacde5
commit
22b65a8edc
1 changed files with 4 additions and 4 deletions
|
@ -1035,15 +1035,15 @@ allcaps8x3(s)
|
||||||
char *end = strchr(s, '\0');
|
char *end = strchr(s, '\0');
|
||||||
if (dot != NULL) {
|
if (dot != NULL) {
|
||||||
if (dot-s > 8)
|
if (dot-s > 8)
|
||||||
return 1; /* More than 8 before '.' */
|
return 0; /* More than 8 before '.' */
|
||||||
if (end-dot > 4)
|
if (end-dot > 4)
|
||||||
return 1; /* More than 3 after '.' */
|
return 0; /* More than 3 after '.' */
|
||||||
end = strchr(dot+1, '.');
|
end = strchr(dot+1, '.');
|
||||||
if (end != NULL)
|
if (end != NULL)
|
||||||
return 1; /* More than one dot */
|
return 0; /* More than one dot */
|
||||||
}
|
}
|
||||||
else if (end-s > 8)
|
else if (end-s > 8)
|
||||||
return 1; /* More than 8 and no dot */
|
return 0; /* More than 8 and no dot */
|
||||||
while ((c = *s++)) {
|
while ((c = *s++)) {
|
||||||
if (islower(c))
|
if (islower(c))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue