From 52d38ab2d9c8b6300f03ef539fa6b5320379a92b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 6 Jan 1999 10:08:24 +0000 Subject: [PATCH] (IT_write_glyphs): Move constant expression out of the loop. --- src/msdos.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/msdos.c b/src/msdos.c index 9b70fbea74e..7abe41a6124 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -695,6 +695,12 @@ IT_write_glyphs (GLYPH *str, int str_len) ? &terminal_coding : &safe_terminal_coding; + /* Do we need to consider conversion of unibyte characters to + multibyte? */ + int convert_unibyte_characters + = NILP (current_buffer->enable_multibyte_characters) + && unibyte_display_via_language_environment; + if (str_len == 0) return; screen_buf = screen_bp = alloca (str_len * 2); @@ -729,9 +735,7 @@ IT_write_glyphs (GLYPH *str, int str_len) /* We only want to convert unibyte characters to multibyte in unibyte buffers! Otherwise, the 8-bit code might come from the display table set up to display foreign characters. */ - if (NILP (current_buffer->enable_multibyte_characters) - && unibyte_display_via_language_environment - && SINGLE_BYTE_CHAR_P (ch) + if (SINGLE_BYTE_CHAR_P (ch) && convert_unibyte_characters && (ch >= 0240 || (ch >= 0200 && !NILP (Vnonascii_translation_table)))) ch = unibyte_char_to_multibyte (ch); -- 2.39.2