mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bom
mark. Added unit test.
This commit is contained in:
parent
cf117b0b40
commit
f032f86e9e
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue