diff options
author | tron <tron> | 1998-02-09 18:14:06 +0000 |
---|---|---|
committer | tron <tron> | 1998-02-09 18:14:06 +0000 |
commit | 16e802b9d05c82b8d0a955ebb5c77209f39cd2e6 (patch) | |
tree | 9d9edd84f530a0dec29c4d32ee82e9c5798d5fb7 /lang/python | |
parent | f4e70476b73e3df494cdd2d0d1a661613a212c24 (diff) | |
download | pkgsrc-16e802b9d05c82b8d0a955ebb5c77209f39cd2e6.tar.gz |
Add patch to fix python's problem with some national character sets.
Fixes PR pkg/4960 by Jaromir Dolecek.
Diffstat (limited to 'lang/python')
-rw-r--r-- | lang/python/patches/patch-ac | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lang/python/patches/patch-ac b/lang/python/patches/patch-ac new file mode 100644 index 00000000000..f57f391bec5 --- /dev/null +++ b/lang/python/patches/patch-ac @@ -0,0 +1,35 @@ +--- Parser/tokenizer.c.orig Tue Apr 29 23:03:03 1997 ++++ Parser/tokenizer.c Mon Feb 9 13:05:34 1998 +@@ -46,6 +46,14 @@ + /* Don't ever change this -- it would break the portability of Python code */ + #define TABSIZE 8 + ++/* Convert a possibly signed character to a nonnegative int */ ++/* XXX This assumes characters are 8 bits wide */ ++#ifdef __CHAR_UNSIGNED__ ++#define Py_CHARMASK(c) (c) ++#else ++#define Py_CHARMASK(c) ((c) & 0xff) ++#endif ++ + /* Forward */ + static struct tok_state *tok_new Py_PROTO((void)); + static int tok_nextc Py_PROTO((struct tok_state *tok)); +@@ -178,7 +186,7 @@ + { + for (;;) { + if (tok->cur != tok->inp) { +- return *tok->cur++; /* Fast path */ ++ return Py_CHARMASK(*tok->cur++); /* Fast path */ + } + if (tok->done != E_OK) + return EOF; +@@ -197,7 +205,7 @@ + tok->buf = tok->cur; + tok->lineno++; + tok->inp = end; +- return *tok->cur++; ++ return Py_CHARMASK(*tok->cur++); + } + if (tok->prompt != NULL) { + char *new = PyOS_Readline(tok->prompt); |