]> granicus.if.org Git - python/commitdiff
UTF-8 decoder: set consumed value in the latin1 fast-path
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Nov 2011 00:23:02 +0000 (01:23 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Nov 2011 00:23:02 +0000 (01:23 +0100)
Objects/unicodeobject.c

index 9c6458db82045a966b0f1c726066c21ad083307d..30a1377add99b9609c374e6dde575f73c30ecb71 100644 (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]);