From: Kenichi Handa Date: Fri, 12 Nov 1999 00:09:03 +0000 (+0000) Subject: (Ftranslate_region): Check the buffer multibyteness. X-Git-Tag: emacs-pretest-21.0.90~6121 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e8cce5afa5a25469717cf30a5545e346aab06a2d;p=emacs.git (Ftranslate_region): Check the buffer multibyteness. --- diff --git a/src/editfns.c b/src/editfns.c index d648fd24f7d..f6f30ee99a2 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2425,6 +2425,7 @@ It returns the number of characters changed.") int cnt; /* Number of changes made. */ int size; /* Size of translate table. */ int pos; + int multibyte = !NILP (current_buffer->enable_multibyte_characters); validate_region (&start, &end); CHECK_STRING (table, 2); @@ -2445,7 +2446,10 @@ It returns the number of characters changed.") int oc; int pos_byte_next; - oc = STRING_CHAR_AND_LENGTH (p, stop - pos_byte, len); + if (multibyte) + oc = STRING_CHAR_AND_LENGTH (p, stop - pos_byte, len); + else + oc = *p, len = 1; pos_byte_next = pos_byte + len; if (oc < size && len == 1) {