1049 |
Lisp_Object string; |
Lisp_Object string; |
1050 |
{ |
{ |
1051 |
unsigned char *buf; |
unsigned char *buf; |
1052 |
|
Lisp_Object ret; |
1053 |
|
|
1054 |
if (! STRING_MULTIBYTE (string)) |
if (! STRING_MULTIBYTE (string)) |
1055 |
return string; |
return string; |
1056 |
|
|
1057 |
buf = (unsigned char *) alloca (SCHARS (string)); |
/* We can not use alloca here, because string might be very long. |
1058 |
|
For example when selecting megabytes of text and then pasting it to |
1059 |
|
another application. */ |
1060 |
|
buf = (unsigned char *) xmalloc (SCHARS (string)); |
1061 |
|
|
1062 |
copy_text (SDATA (string), buf, SBYTES (string), |
copy_text (SDATA (string), buf, SBYTES (string), |
1063 |
1, 0); |
1, 0); |
1064 |
|
|
1065 |
return make_unibyte_string (buf, SCHARS (string)); |
ret = make_unibyte_string (buf, SCHARS (string)); |
1066 |
|
|
1067 |
|
xfree (buf); |
1068 |
|
|
1069 |
|
return ret; |
1070 |
} |
} |
1071 |
|
|
1072 |
DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, |
DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, |