diff options
author | Just van Rossum <just@letterror.com> | 2003-02-09 20:38:48 +0000 |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2003-02-09 20:38:48 +0000 |
commit | e3e79f236627400d88a469f352a72bda23572365 (patch) | |
tree | c47ab6ae0ff96c326aa4ce86de413b519e5734d2 /Parser/tokenizer.c | |
parent | 6483f608bee9c2d1ea655ef2f63bc16b8cf0807f (diff) | |
download | cpython-e3e79f236627400d88a469f352a72bda23572365.tar.gz |
patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index aaed637a2f..4952a3c447 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -506,14 +506,14 @@ decoding_feof(struct tok_state *tok) /* Fetch a byte from TOK, using the string buffer. */ static int buf_getc(struct tok_state *tok) { - return *tok->str++; + return Py_CHARMASK(*tok->str++); } /* Unfetch a byte from TOK, using the string buffer. */ static void buf_ungetc(int c, struct tok_state *tok) { tok->str--; - assert(*tok->str == c); /* tok->cur may point to read-only segment */ + assert(Py_CHARMASK(*tok->str) == c); /* tok->cur may point to read-only segment */ } /* Set the readline function for TOK to ENC. For the string-based |