diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-08 23:03:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-11-08 23:03:45 (GMT) |
commit | 62aa4d086a072303e1dee2458b402b9b35d9e1e4 (patch) | |
tree | 056498cad62dc21bac8c19ca744d2827b38f6c31 /Objects | |
parent | 0a045efb49ba20717dba115bd309544bfae16303 (diff) | |
download | cpython-62aa4d086a072303e1dee2458b402b9b35d9e1e4.zip cpython-62aa4d086a072303e1dee2458b402b9b35d9e1e4.tar.gz cpython-62aa4d086a072303e1dee2458b402b9b35d9e1e4.tar.bz2 |
Strip trailing spaces
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 26f2c8b..5f9539b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -4338,7 +4338,7 @@ PyUnicode_DecodeUTF8Stateful(const char *s, maxchar = utf8_max_char_size_and_has_errors(s, size, &unicode_size, consumed, &has_errors); if (has_errors) - /* maxchar and size computation might be incorrect; + /* maxchar and size computation might be incorrect; code below widens and resizes as necessary. */ unicode = PyUnicode_New(size, 127); else @@ -5321,8 +5321,8 @@ PyUnicode_DecodeUTF16Stateful(const char *s, Py_UNICODE ch2 = (q[ihi] << 8) | q[ilo]; q += 2; if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { - if (unicode_putchar(&unicode, &outpos, - (((ch & 0x3FF)<<10) | + if (unicode_putchar(&unicode, &outpos, + (((ch & 0x3FF)<<10) | (ch2 & 0x3FF)) + 0x10000) < 0) goto onError; continue; @@ -7653,7 +7653,7 @@ PyUnicode_DecodeCharmap(const char *s, if (targetsize == 1) { /* 1-1 mapping */ - if (unicode_putchar(&v, &outpos, + if (unicode_putchar(&v, &outpos, PyUnicode_READ_CHAR(x, 0)) < 0) goto onError; } |