comparison src/term.c @ 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 d40f9a8d7779
children e81f007b15fa
comparison
equal deleted inserted replaced
23337:9da211023264 23338:0a2b76b09162
856 len = GLYPH_LENGTH (tbase, g); 856 len = GLYPH_LENGTH (tbase, g);
857 buf = GLYPH_STRING (tbase, g); 857 buf = GLYPH_STRING (tbase, g);
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 }
871 *consumed = src - src_start; 877 *consumed = src - src_start;
872 return (dst - dst_start); 878 return (dst - dst_start);