Commit 8cdea344 authored by Martin v. Löwis's avatar Martin v. Löwis

Use Py_CHARMASK for ctype macros. Fixes bug #232787.

parent 5c06109e
...@@ -397,7 +397,7 @@ time_strptime(PyObject *self, PyObject *args) ...@@ -397,7 +397,7 @@ time_strptime(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_ValueError, "format mismatch"); PyErr_SetString(PyExc_ValueError, "format mismatch");
return NULL; return NULL;
} }
while (*s && isspace(*s)) while (*s && isspace(Py_CHARMASK(*s)))
s++; s++;
if (*s) { if (*s) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
......
...@@ -182,7 +182,7 @@ PyInt_FromString(char *s, char **pend, int base) ...@@ -182,7 +182,7 @@ PyInt_FromString(char *s, char **pend, int base)
x = (long) PyOS_strtoul(s, &end, base); x = (long) PyOS_strtoul(s, &end, base);
else else
x = PyOS_strtol(s, &end, base); x = PyOS_strtol(s, &end, base);
if (end == s || !isalnum(end[-1])) if (end == s || !isalnum(Py_CHARMASK(end[-1])))
goto bad; goto bad;
while (*end && isspace(Py_CHARMASK(*end))) while (*end && isspace(Py_CHARMASK(*end)))
end++; end++;
......
...@@ -402,7 +402,7 @@ PyErr_Format(PyObject *exception, const char *format, ...) ...@@ -402,7 +402,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
for (f = format; *f; f++) { for (f = format; *f; f++) {
if (*f == '%') { if (*f == '%') {
const char* p = f; const char* p = f;
while (*++f && *f != '%' && !isalpha(*f)) while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
; ;
switch (*f) { switch (*f) {
case 'c': case 'c':
...@@ -457,15 +457,15 @@ PyErr_Format(PyObject *exception, const char *format, ...) ...@@ -457,15 +457,15 @@ PyErr_Format(PyObject *exception, const char *format, ...)
/* parse the width.precision part (we're only /* parse the width.precision part (we're only
interested in the precision value, if any) */ interested in the precision value, if any) */
n = 0; n = 0;
while (isdigit(*f)) while (isdigit(Py_CHARMASK(*f)))
n = (n*10) + *f++ - '0'; n = (n*10) + *f++ - '0';
if (*f == '.') { if (*f == '.') {
f++; f++;
n = 0; n = 0;
while (isdigit(*f)) while (isdigit(Py_CHARMASK(*f)))
n = (n*10) + *f++ - '0'; n = (n*10) + *f++ - '0';
} }
while (*f && *f != '%' && !isalpha(*f)) while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f)))
f++; f++;
switch (*f) { switch (*f) {
case 'c': case 'c':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment