changeset 23338:0a2b76b09162

(encode_terminal_code): Handle raw 8-bit codes correctly.
author Kenichi Handa <handa@m17n.org>
date Mon, 28 Sep 1998 11:52:53 +0000
parents 9da211023264
children 2da87b489590
files src/term.c
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/term.c	Mon Sep 28 11:03:36 1998 +0000
+++ b/src/term.c	Mon Sep 28 11:52:53 1998 +0000
@@ -858,13 +858,19 @@
 	    }
 	  
 	  encode_coding (coding, buf, dst, len, dst_end - dst);
-	  if (coding->consumed < len)
-	    /* We get a carryover because the remaining output
-	       buffer is too short.  We must break the loop here
-	       without increasing SRC so that the next call of
-	       this function start from the same glyph.  */
-	    break;
+	  len -= coding->consumed;
 	  dst += coding->produced;
+	  if (len > 0)
+	    {
+	      if (len > dst_end - dst)
+		/* The remaining output buffer is too short.  We must
+		   break the loop here without increasing SRC so that
+		   the next call of this function start from the same
+		   glyph.  */
+		break;
+	      buf += len;
+	      while (len--) *dst++ = *buf++;
+	    }
 	}
       src++;
     }