Mercurial > emacs
diff src/alloc.c @ 50200:fdeb795fc0ec
(make_specified_string): Fix previous change.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Wed, 19 Mar 2003 12:24:43 +0000 |
| parents | d9ade23e09df |
| children | a617ca0d5d85 |
line wrap: on
line diff
--- a/src/alloc.c Wed Mar 19 12:09:37 2003 +0000 +++ b/src/alloc.c Wed Mar 19 12:24:43 2003 +0000 @@ -1819,7 +1819,8 @@ /* 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 @@ 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)
