]> code.delx.au - gnu-emacs/commitdiff
Fixes: debbugs:17865
authorAndreas Schwab <schwab@linux-m68k.org>
Sat, 28 Jun 2014 07:24:01 +0000 (09:24 +0200)
committerAndreas Schwab <schwab@linux-m68k.org>
Sat, 28 Jun 2014 07:24:01 +0000 (09:24 +0200)
* coding.c (encode_coding_utf_8): Correctly count produced_chars
also in unibyte case.

src/ChangeLog
src/coding.c

index 3e3c0cba183a1ca57fa315a53eea16ed39c92c1d..eac62eef7a7d56a34752a1739bbff14765ea8163 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-28  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * coding.c (encode_coding_utf_8): Correctly count produced_chars
+       also in unibyte case.  (Bug#17865)
+
 2014-06-25  Glenn Morris  <rgm@gnu.org>
 
        * puresize.h (BASE_PURESIZE): Increase a bit.  (Bug#17846)
index 654e39c0e3dd200b6dc5b25d524ad0ed03df60ec..bd4a8be08b3b49da3f6abbc83373cc9c481aea9d 100644 (file)
@@ -1549,8 +1549,8 @@ encode_coding_utf_8 (struct coding_system *coding)
            *dst++ = CHAR_TO_BYTE8 (c);
          else
            CHAR_STRING_ADVANCE_NO_UNIFY (c, dst);
-         produced_chars++;
        }
+      produced_chars = dst - (coding->destination + coding->produced);
     }
   record_conversion_result (coding, CODING_RESULT_SUCCESS);
   coding->produced_char += produced_chars;