From 2b6727bd8a714d334d34e6a9fabc1d0f651633a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 6 Mar 2001 12:12:02 +0000 Subject: Use Py_CHARMASK for ctype macros. Fixes bug #232787. --- Modules/timemodule.c | 2 +- Objects/intobject.c | 2 +- Python/errors.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index c4a066f..90886f2 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -397,7 +397,7 @@ time_strptime(PyObject *self, PyObject *args) PyErr_SetString(PyExc_ValueError, "format mismatch"); return NULL; } - while (*s && isspace(*s)) + while (*s && isspace(Py_CHARMASK(*s))) s++; if (*s) { PyErr_Format(PyExc_ValueError, diff --git a/Objects/intobject.c b/Objects/intobject.c index 72d5323..9a1f0e6 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -182,7 +182,7 @@ PyInt_FromString(char *s, char **pend, int base) x = (long) PyOS_strtoul(s, &end, base); else x = PyOS_strtol(s, &end, base); - if (end == s || !isalnum(end[-1])) + if (end == s || !isalnum(Py_CHARMASK(end[-1]))) goto bad; while (*end && isspace(Py_CHARMASK(*end))) end++; diff --git a/Python/errors.c b/Python/errors.c index 7f30f7e..8d02b8e 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -402,7 +402,7 @@ PyErr_Format(PyObject *exception, const char *format, ...) for (f = format; *f; f++) { if (*f == '%') { const char* p = f; - while (*++f && *f != '%' && !isalpha(*f)) + while (*++f && *f != '%' && !isalpha(Py_CHARMASK(*f))) ; switch (*f) { case 'c': @@ -457,15 +457,15 @@ PyErr_Format(PyObject *exception, const char *format, ...) /* parse the width.precision part (we're only interested in the precision value, if any) */ n = 0; - while (isdigit(*f)) + while (isdigit(Py_CHARMASK(*f))) n = (n*10) + *f++ - '0'; if (*f == '.') { f++; n = 0; - while (isdigit(*f)) + while (isdigit(Py_CHARMASK(*f))) n = (n*10) + *f++ - '0'; } - while (*f && *f != '%' && !isalpha(*f)) + while (*f && *f != '%' && !isalpha(Py_CHARMASK(*f))) f++; switch (*f) { case 'c': -- cgit v0.12