diff src/doc.c @ 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 81a6345fd5e8
children 0a7261c1d487
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.