# HG changeset patch # User Richard M. Stallman # Date 890503741 0 # Node ID 4ac9ba6e745d36013de54c7cf293e99c66c81650 # Parent 3abae7d11d0732cec63a35353f8b06ae74e4b39e (substring_both, Fsubstring): Use make_specified_string. (concat): Make string result unibyte or multibyte as appropriate. diff -r 3abae7d11d07 -r 4ac9ba6e745d src/fns.c --- a/src/fns.c Sat Mar 21 18:07:27 1998 +0000 +++ b/src/fns.c Sat Mar 21 18:09:01 1998 +0000 @@ -507,8 +507,10 @@ val = Fmake_list (make_number (result_len), Qnil); else if (target_type == Lisp_Vectorlike) val = Fmake_vector (make_number (result_len), Qnil); + else if (some_multibyte) + val = make_uninit_multibyte_string (result_len, result_len_byte); else - val = make_uninit_multibyte_string (result_len, result_len_byte); + val = make_uninit_string (result_len); /* In `append', if all but last arg are nil, return last arg. */ if (target_type == Lisp_Cons && EQ (val, Qnil)) @@ -966,8 +968,9 @@ if (STRINGP (string)) { - res = make_multibyte_string (XSTRING (string)->data + from_byte, - to_char - from_char, to_byte - from_byte); + res = make_specified_string (XSTRING (string)->data + from_byte, + to_char - from_char, to_byte - from_byte, + STRING_MULTIBYTE (string)); copy_text_properties (from_char, to_char, string, make_number (0), res, Qnil); } @@ -1006,8 +1009,9 @@ if (STRINGP (string)) { - res = make_multibyte_string (XSTRING (string)->data + from_byte, - to - from, to_byte - from_byte); + res = make_specified_string (XSTRING (string)->data + from_byte, + to - from, to_byte - from_byte, + STRING_MULTIBYTE (string)); copy_text_properties (from, to, string, make_number (0), res, Qnil); } else