aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fns.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fns.c b/src/fns.c
index 6f6694c1318..3b74db33ca2 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -507,8 +507,10 @@ concat (nargs, args, target_type, last_special)
507 val = Fmake_list (make_number (result_len), Qnil); 507 val = Fmake_list (make_number (result_len), Qnil);
508 else if (target_type == Lisp_Vectorlike) 508 else if (target_type == Lisp_Vectorlike)
509 val = Fmake_vector (make_number (result_len), Qnil); 509 val = Fmake_vector (make_number (result_len), Qnil);
510 else 510 else if (some_multibyte)
511 val = make_uninit_multibyte_string (result_len, result_len_byte); 511 val = make_uninit_multibyte_string (result_len, result_len_byte);
512 else
513 val = make_uninit_string (result_len);
512 514
513 /* In `append', if all but last arg are nil, return last arg. */ 515 /* In `append', if all but last arg are nil, return last arg. */
514 if (target_type == Lisp_Cons && EQ (val, Qnil)) 516 if (target_type == Lisp_Cons && EQ (val, Qnil))
@@ -966,8 +968,9 @@ This function allows vectors as well as strings.")
966 968
967 if (STRINGP (string)) 969 if (STRINGP (string))
968 { 970 {
969 res = make_multibyte_string (XSTRING (string)->data + from_byte, 971 res = make_specified_string (XSTRING (string)->data + from_byte,
970 to_char - from_char, to_byte - from_byte); 972 to_char - from_char, to_byte - from_byte,
973 STRING_MULTIBYTE (string));
971 copy_text_properties (from_char, to_char, string, 974 copy_text_properties (from_char, to_char, string,
972 make_number (0), res, Qnil); 975 make_number (0), res, Qnil);
973 } 976 }
@@ -1006,8 +1009,9 @@ substring_both (string, from, from_byte, to, to_byte)
1006 1009
1007 if (STRINGP (string)) 1010 if (STRINGP (string))
1008 { 1011 {
1009 res = make_multibyte_string (XSTRING (string)->data + from_byte, 1012 res = make_specified_string (XSTRING (string)->data + from_byte,
1010 to - from, to_byte - from_byte); 1013 to - from, to_byte - from_byte,
1014 STRING_MULTIBYTE (string));
1011 copy_text_properties (from, to, string, make_number (0), res, Qnil); 1015 copy_text_properties (from, to, string, make_number (0), res, Qnil);
1012 } 1016 }
1013 else 1017 else