changeset 90809:3c52757d5f6e

(produce_chars): Don't call insert_from_gap if no characters to produce. (encode_coding): Likewise.
author Kenichi Handa <handa@m17n.org>
date Tue, 24 Apr 2007 08:13:48 +0000
parents 5021c896064c
children f586b66d5c40
files src/coding.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/coding.c	Mon Apr 23 04:14:25 2007 +0000
+++ b/src/coding.c	Tue Apr 24 08:13:48 2007 +0000
@@ -6079,7 +6079,7 @@
     }
 
   produced = dst - (coding->destination + coding->produced);
-  if (BUFFERP (coding->dst_object))
+  if (BUFFERP (coding->dst_object) && produced_chars > 0)
     insert_from_gap (produced_chars, produced);
   coding->produced += produced;
   coding->produced_char += produced_chars;
@@ -6648,7 +6648,7 @@
     (*(coding->encoder)) (coding);
   } while (coding->consumed_char < coding->src_chars);
 
-  if (BUFFERP (coding->dst_object))
+  if (BUFFERP (coding->dst_object) && coding->produced_char > 0)
     insert_from_gap (coding->produced_char, coding->produced);
 
   return (coding->result);