aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index d703d3d99b2..2c1d09ac43e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1819,7 +1819,8 @@ make_string_from_bytes (contents, nchars, nbytes)
1819 1819
1820/* Make a string from NCHARS characters occupying NBYTES bytes at 1820/* Make a string from NCHARS characters occupying NBYTES bytes at
1821 CONTENTS. The argument MULTIBYTE controls whether to label the 1821 CONTENTS. The argument MULTIBYTE controls whether to label the
1822 string as multibyte. */ 1822 string as multibyte. If NCHARS is negative, it counts the number of
1823 characters by itself. */
1823 1824
1824Lisp_Object 1825Lisp_Object
1825make_specified_string (contents, nchars, nbytes, multibyte) 1826make_specified_string (contents, nchars, nbytes, multibyte)
@@ -1828,6 +1829,14 @@ make_specified_string (contents, nchars, nbytes, multibyte)
1828 int multibyte; 1829 int multibyte;
1829{ 1830{
1830 register Lisp_Object val; 1831 register Lisp_Object val;
1832
1833 if (nchars < 0)
1834 {
1835 if (multibyte)
1836 nchars = multibyte_chars_in_text (contents, nbytes);
1837 else
1838 nchars = nbytes;
1839 }
1831 val = make_uninit_multibyte_string (nchars, nbytes); 1840 val = make_uninit_multibyte_string (nchars, nbytes);
1832 bcopy (contents, SDATA (val), nbytes); 1841 bcopy (contents, SDATA (val), nbytes);
1833 if (!multibyte) 1842 if (!multibyte)