From fb2fdea71ca69f2d4d2b569b5e91c5b14c07645c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Tue, 6 Apr 1999 19:50:49 +0000 Subject: [PATCH] (get_doc_string): When UNIBYTE and DEFINITION are 0, let the data control whether string is unibyte. --- src/doc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/doc.c b/src/doc.c index a28fd58793b..af7c55e0b20 100644 --- a/src/doc.c +++ b/src/doc.c @@ -275,8 +275,15 @@ get_doc_string (filepos, unibyte, definition) 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. -- 2.39.2