UTF-8 decoder: set consumed value in the latin1 fast-path

This commit is contained in:
Victor Stinner 2011-11-22 01:23:02 +01:00
parent d3df8ab377
commit 42885206ec

View File

@ -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]);