summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-05-21 22:50:28 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-05-21 22:50:28 (GMT)
commitd6703b5e38baac6b85c1c2cf9311e11e4916984b (patch)
tree5cb3fb2d2ae8fe340ed8a89b9b1fc3896b7bcb50 /Modules/cjkcodecs
parentfa0fdb89e98fbbec7da9891dde2647fb951888c8 (diff)
downloadcpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.zip
cpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.tar.gz
cpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.tar.bz2
Issue #5640: Fix Shift-JIS incremental encoder for error handlers different
than strict
Diffstat (limited to 'Modules/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 56251f3..1f31595 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -498,7 +498,6 @@ multibytecodec_encode(MultibyteCodec *codec,
outleft = (Py_ssize_t)(buf.outbuf_end - buf.outbuf);
r = codec->encode(state, codec->config, &buf.inbuf, inleft,
&buf.outbuf, outleft, flags);
- *data = buf.inbuf;
if ((r == 0) || (r == MBERR_TOOFEW && !(flags & MBENC_FLUSH)))
break;
else if (multibytecodec_encerror(codec, state, &buf, errors,r))
@@ -528,6 +527,7 @@ multibytecodec_encode(MultibyteCodec *codec,
if (_PyString_Resize(&buf.outobj, finalsize) == -1)
goto errorexit;
+ *data = buf.inbuf;
Py_XDECREF(buf.excobj);
return buf.outobj;