From: Victor Stinner Date: Tue, 22 Nov 2011 00:23:02 +0000 (+0100) Subject: UTF-8 decoder: set consumed value in the latin1 fast-path X-Git-Tag: v3.3.0a1~758 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42885206ece169e148314def9ade7054675a068c;p=python UTF-8 decoder: set consumed value in the latin1 fast-path --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9c6458db82..30a1377add 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]);