# HG changeset patch # User Kenichi Handa # Date 1048076683 0 # Node ID fdeb795fc0ecce2541b2e62e52d7cfaf9889bc73 # Parent 2e56eaaf925b038de5ed7ef9deac6b5847a63cf1 (make_specified_string): Fix previous change. diff -r 2e56eaaf925b -r fdeb795fc0ec src/alloc.c --- 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)