From d5ceef4c8de61358f630646cd7d7eae58af7f76e Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Sat, 31 Mar 2001 07:33:56 +0000 Subject: Use Py_CHARMASK for ctype macros. Fixes bug #232787. --- Misc/NEWS | 2 ++ Modules/timemodule.c | 2 +- Objects/intobject.c | 2 +- Python/errors.c | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 46cb28a..5968689 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -74,6 +74,8 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=&group_id=5470&atid - Patch #103636: Allow writing strings containing null bytes to an SSL socket +- #232787 -- Modules/timemodule.c, Python/errors.c, Objects/intobject.c + What's New in Python 2.0? ========================= diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 116b377..39a7fb9 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -382,7 +382,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 c9d1f6a..829b010 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 28dfbbe..1d30dac 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