diff options
| author | Miles Bader | 2007-06-11 01:00:07 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-06-11 01:00:07 +0000 |
| commit | 67f3ad67ee317226cb5d1bb139de0cfd883fdc5e (patch) | |
| tree | 58a0e1bea7a1d8728fd32e6127a44434e7eac006 /src/alloc.c | |
| parent | d17cf4eb2024cf54e4a216312184665094ee3df4 (diff) | |
| parent | 2d715b39ea1c89066f469405d065dd1a6631d28e (diff) | |
| download | emacs-67f3ad67ee317226cb5d1bb139de0cfd883fdc5e.tar.gz emacs-67f3ad67ee317226cb5d1bb139de0cfd883fdc5e.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 781-792)
- Update from CVS
- Merge from gnus--rel--5.10
- Merge from emacs--rel--22
* emacs--rel--22 (patch 33-41)
* gnus--rel--5.10 (patch 226-228)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-21
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 574196059f8..cc6d1d55870 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1759,6 +1759,8 @@ init_strings () | |||
| 1759 | string_blocks = NULL; | 1759 | string_blocks = NULL; |
| 1760 | n_string_blocks = 0; | 1760 | n_string_blocks = 0; |
| 1761 | string_free_list = NULL; | 1761 | string_free_list = NULL; |
| 1762 | empty_unibyte_string = make_pure_string ("", 0, 0, 0); | ||
| 1763 | empty_multibyte_string = make_pure_string ("", 0, 0, 1); | ||
| 1762 | } | 1764 | } |
| 1763 | 1765 | ||
| 1764 | 1766 | ||
| @@ -2482,6 +2484,9 @@ make_uninit_string (length) | |||
| 2482 | int length; | 2484 | int length; |
| 2483 | { | 2485 | { |
| 2484 | Lisp_Object val; | 2486 | Lisp_Object val; |
| 2487 | |||
| 2488 | if (!length) | ||
| 2489 | return empty_unibyte_string; | ||
| 2485 | val = make_uninit_multibyte_string (length, length); | 2490 | val = make_uninit_multibyte_string (length, length); |
| 2486 | STRING_SET_UNIBYTE (val); | 2491 | STRING_SET_UNIBYTE (val); |
| 2487 | return val; | 2492 | return val; |
| @@ -2500,6 +2505,8 @@ make_uninit_multibyte_string (nchars, nbytes) | |||
| 2500 | 2505 | ||
| 2501 | if (nchars < 0) | 2506 | if (nchars < 0) |
| 2502 | abort (); | 2507 | abort (); |
| 2508 | if (!nbytes) | ||
| 2509 | return empty_multibyte_string; | ||
| 2503 | 2510 | ||
| 2504 | s = allocate_string (); | 2511 | s = allocate_string (); |
| 2505 | allocate_string_data (s, nchars, nbytes); | 2512 | allocate_string_data (s, nchars, nbytes); |