changeset 24573:aa24b1cb428a

(get_doc_string): When UNIBYTE and DEFINITION are 0, let the data control whether string is unibyte.
author Richard M. Stallman <rms@gnu.org>
date Tue, 06 Apr 1999 19:50:49 +0000
parents 9fb4096c5f77
children baecd14c2bb2
files src/doc.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/doc.c	Tue Apr 06 19:36:02 1999 +0000
+++ b/src/doc.c	Tue Apr 06 19:50:49 1999 +0000
@@ -275,8 +275,15 @@
     return make_unibyte_string (get_doc_string_buffer + offset,
 				to - (get_doc_string_buffer + offset));
   else
-    return make_string (get_doc_string_buffer + offset,
-			to - (get_doc_string_buffer + offset));
+    {
+      /* Let the data determine whether the string is multibyte,
+	 even if Emacs is running in --unibyte mode.  */
+      int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset,
+					    to - (get_doc_string_buffer + offset));
+      return make_string_from_bytes (get_doc_string_buffer + offset,
+				     nchars,
+				     to - (get_doc_string_buffer + offset));
+    }
 }
 
 /* Get a string from position FILEPOS and pass it through the Lisp reader.