]> git.eshelyaron.com Git - emacs.git/commitdiff
(read_process_output): Before inserting the decoded
authorKenichi Handa <handa@m17n.org>
Thu, 7 Sep 2000 01:14:20 +0000 (01:14 +0000)
committerKenichi Handa <handa@m17n.org>
Thu, 7 Sep 2000 01:14:20 +0000 (01:14 +0000)
text in the buffer, adjust the multibyteness.

src/process.c

index 35fca18ff28843c3c3f2b31d11724793193730b3..49dcaea467c6fb01d1128d87c1f45fb0d58b04a4 100644 (file)
@@ -3075,6 +3075,12 @@ read_process_output (proc, channel)
       bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data,
             carryover);
       XSETINT (p->decoding_carryover, carryover);
+      /* Adjust the multibyteness of TEXT to that of the buffer.  */
+      if (NILP (current_buffer->enable_multibyte_characters)
+         != ! STRING_MULTIBYTE (text))
+       text = (STRING_MULTIBYTE (text)
+               ? Fstring_as_unibyte (text)
+               : Fstring_as_multibyte (text));
       nbytes = STRING_BYTES (XSTRING (text));
       nchars = XSTRING (text)->size;
       insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0);