diff options
| author | Kenichi Handa | 2003-03-19 12:24:43 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-03-19 12:24:43 +0000 |
| commit | 229b28c432a6df8b02b8f6cb492ffd1bedb8db5c (patch) | |
| tree | a12db9231662da78895c5dcdb51a69c47e36a80b /src/alloc.c | |
| parent | 602040466d9273df9682fcce612a17586db3c20a (diff) | |
| download | emacs-229b28c432a6df8b02b8f6cb492ffd1bedb8db5c.tar.gz emacs-229b28c432a6df8b02b8f6cb492ffd1bedb8db5c.zip | |
(make_specified_string): Fix previous change.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 11 |
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 | ||
| 1824 | Lisp_Object | 1825 | Lisp_Object |
| 1825 | make_specified_string (contents, nchars, nbytes, multibyte) | 1826 | make_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) |