aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-09-28 11:52:53 +0000
committerKenichi Handa1998-09-28 11:52:53 +0000
commitc42869c47d6a598ded22d5e929d5388d3b6cb9f3 (patch)
tree70095912df1023b922cd6b24cd8eeb55158f2332 /src
parent2b9413932e29da3556434e5f78d3a7223d66c936 (diff)
downloademacs-c42869c47d6a598ded22d5e929d5388d3b6cb9f3.tar.gz
emacs-c42869c47d6a598ded22d5e929d5388d3b6cb9f3.zip
(encode_terminal_code): Handle raw 8-bit codes correctly.
Diffstat (limited to 'src')
-rw-r--r--src/term.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/term.c b/src/term.c
index de48cb0eb88..17607cea5d5 100644
--- a/src/term.c
+++ b/src/term.c
@@ -858,13 +858,19 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
858 } 858 }
859 859
860 encode_coding (coding, buf, dst, len, dst_end - dst); 860 encode_coding (coding, buf, dst, len, dst_end - dst);
861 if (coding->consumed < len) 861 len -= coding->consumed;
862 /* We get a carryover because the remaining output
863 buffer is too short. We must break the loop here
864 without increasing SRC so that the next call of
865 this function start from the same glyph. */
866 break;
867 dst += coding->produced; 862 dst += coding->produced;
863 if (len > 0)
864 {
865 if (len > dst_end - dst)
866 /* The remaining output buffer is too short. We must
867 break the loop here without increasing SRC so that
868 the next call of this function start from the same
869 glyph. */
870 break;
871 buf += len;
872 while (len--) *dst++ = *buf++;
873 }
868 } 874 }
869 src++; 875 src++;
870 } 876 }