summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 00:23:02 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-22 00:23:02 (GMT)
commit42885206ece169e148314def9ade7054675a068c (patch)
treeca0a8d441ff6e9bd6239f9abb62c4e128672a7c4 /Objects/unicodeobject.c
parentd3df8ab3779f682fc2319077c2c422acc8430c02 (diff)
downloadcpython-42885206ece169e148314def9ade7054675a068c.zip
cpython-42885206ece169e148314def9ade7054675a068c.tar.gz
cpython-42885206ece169e148314def9ade7054675a068c.tar.bz2
UTF-8 decoder: set consumed value in the latin1 fast-path
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 9c6458d..30a1377 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -4391,6 +4391,9 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
unicode_size may be != size if there is an incomplete UTF-8
sequence at the end of the ASCII block. */
if (maxchar < 128 && size == unicode_size) {
+ if (consumed)
+ *consumed = size;
+
if (size == 1)
return get_latin1_char((unsigned char)s[0]);