[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Coding system conversion error
From: |
Stefan Monnier |
Subject: |
Re: Coding system conversion error |
Date: |
Tue, 08 Feb 2005 18:38:25 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
> I think I found the reason for this, but I am not sure. Can anybody with
> knowledge about multibyte and unibyte string representations comment on the
> patch below (in function allocate_string_data in alloc.c)?
> diff -c alloc.c.~1.363.~ alloc.c
> Index: alloc.c
> *** alloc.c.~1.363.~ 2005-01-20 21:20:32.000000000 +0100
> --- alloc.c 2005-02-08 22:46:02.000000000 +0100
> ***************
> *** 1977,1983 ****
> SDATA_NBYTES (data) = nbytes;
> #endif
s-> size = nchars;
> ! s->size_byte = nbytes;
s-> data[nbytes] = '\0';
> #ifdef GC_CHECK_STRING_OVERRUN
> bcopy (string_overrun_cookie, (char *) data + needed,
> --- 1977,1983 ----
> SDATA_NBYTES (data) = nbytes;
> #endif
s-> size = nchars;
> ! s->size_byte = nchars != nbytes ? nbytes : -1;
s-> data[nbytes] = '\0';
> #ifdef GC_CHECK_STRING_OVERRUN
> bcopy (string_overrun_cookie, (char *) data + needed,
This doesn't look like the right fix.
Normally, the caller would instead use `STRING_SET_UNIBYTE' after the call
(or rather calls one of make_foo_string which does it for him) if needed.
Stefan
- Re: Coding system conversion error (was Re: abort in x_handle_selection_event when copying text), Jan D., 2005/02/08
- Re: Coding system conversion error,
Stefan Monnier <=
- Re: Coding system conversion error, Jan D., 2005/02/10
- Re: Coding system conversion error, Stefan Monnier, 2005/02/10
- Re: Coding system conversion error, Jan D., 2005/02/10
- Re: Coding system conversion error, Kenichi Handa, 2005/02/11
- Re: Coding system conversion error, Jan D., 2005/02/12
- Re: Coding system conversion error, Kim F. Storm, 2005/02/12
- Re: Coding system conversion error, Kenichi Handa, 2005/02/12
- Re: Coding system conversion error, Kim F. Storm, 2005/02/13
- Re: Coding system conversion error, Stefan Monnier, 2005/02/13
- Re: Coding system conversion error, Kenichi Handa, 2005/02/13