(make_specified_string): Fix previous change.
This commit is contained in:
parent
602040466d
commit
229b28c432
1 changed files with 10 additions and 1 deletions
11
src/alloc.c
11
src/alloc.c
|
@ -1819,7 +1819,8 @@ make_string_from_bytes (contents, nchars, nbytes)
|
|||
|
||||
/* Make a string from NCHARS characters occupying NBYTES bytes at
|
||||
CONTENTS. The argument MULTIBYTE controls whether to label the
|
||||
string as multibyte. */
|
||||
string as multibyte. If NCHARS is negative, it counts the number of
|
||||
characters by itself. */
|
||||
|
||||
Lisp_Object
|
||||
make_specified_string (contents, nchars, nbytes, multibyte)
|
||||
|
@ -1828,6 +1829,14 @@ make_specified_string (contents, nchars, nbytes, multibyte)
|
|||
int multibyte;
|
||||
{
|
||||
register Lisp_Object val;
|
||||
|
||||
if (nchars < 0)
|
||||
{
|
||||
if (multibyte)
|
||||
nchars = multibyte_chars_in_text (contents, nbytes);
|
||||
else
|
||||
nchars = nbytes;
|
||||
}
|
||||
val = make_uninit_multibyte_string (nchars, nbytes);
|
||||
bcopy (contents, SDATA (val), nbytes);
|
||||
if (!multibyte)
|
||||
|
|
Loading…
Add table
Reference in a new issue