diff options
| author | Paul Eggert | 2011-06-22 09:25:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-22 09:25:06 -0700 |
| commit | 9f0b1513ad9b24e2f7dec87d3afb32cd6240ccad (patch) | |
| tree | 55150c011230521ce991f0c4ff36d2be4f6742f8 /src/alloc.c | |
| parent | e92b6c884116d70e224e9cb535ed85a2b05665a5 (diff) | |
| parent | 31fd4b3280acee4030efde84a0e23ae2b006ee31 (diff) | |
| download | emacs-9f0b1513ad9b24e2f7dec87d3afb32cd6240ccad.tar.gz emacs-9f0b1513ad9b24e2f7dec87d3afb32cd6240ccad.zip | |
Merge from trunk.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index 00d330c1b6a..69623d103c3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2257,12 +2257,14 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2257 | p = XBOOL_VECTOR (val); | 2257 | p = XBOOL_VECTOR (val); |
| 2258 | p->size = XFASTINT (length); | 2258 | p->size = XFASTINT (length); |
| 2259 | 2259 | ||
| 2260 | memset (p->data, NILP (init) ? 0 : -1, length_in_chars); | 2260 | if (length_in_chars) |
| 2261 | { | ||
| 2262 | memset (p->data, ! NILP (init) ? -1 : 0, length_in_chars); | ||
| 2261 | 2263 | ||
| 2262 | /* Clear the extraneous bits in the last byte. */ | 2264 | /* Clear any extraneous bits in the last byte. */ |
| 2263 | if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) | 2265 | p->data[length_in_chars - 1] |
| 2264 | p->data[length_in_chars - 1] | 2266 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; |
| 2265 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; | 2267 | } |
| 2266 | 2268 | ||
| 2267 | return val; | 2269 | return val; |
| 2268 | } | 2270 | } |