summaryrefslogtreecommitdiff
path: root/lang/python
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>1998-02-09 18:14:06 +0000
committertron <tron@pkgsrc.org>1998-02-09 18:14:06 +0000
commit60041df34c8f3df82c51e106cf3b274d1143e812 (patch)
tree9d9edd84f530a0dec29c4d32ee82e9c5798d5fb7 /lang/python
parent7e0c391c2b848759c7f38e688dd5885876326006 (diff)
downloadpkgsrc-60041df34c8f3df82c51e106cf3b274d1143e812.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-ac35
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);