GNU bug report logs - #870
Missing ^J in ChangeLog

Previous Next

Packages: emacs, w32;

Reported by: "Juanma Barranquero" <lekktu <at> gmail.com>

Date: Wed, 3 Sep 2008 11:10:05 UTC

Severity: normal

Done: Jason Rumney <jasonr <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jason Rumney <jasonr <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 870 <at> debbugs.gnu.org, Emacs Devel <emacs-devel <at> gnu.org>
Subject: bug#870: Repeatable instance of bug#870
Date: Mon, 05 Jan 2009 19:22:16 +0800
Juanma Barranquero wrote:
> On Mon, Jan 5, 2009 at 11:59, Jason Rumney <jasonr <at> gnu.org> wrote:
>
>   
>> It appears that there is a bug in all the decode_coding_* functions when a
>> CR lies on a CHARBUF_SIZE (0x4000) boundary with a matching LF on the other
>> side of the boundary.
>>
>> They all do something like:
>>
>>     if (eol_crlf && c1 == '\r')
>>       ONE_MORE_BYTE (byte_after_cr);
>>
>> but ONE_MORE_BYTE will abort the decode if it reaches the end of the buffer,
>> leaving the CR in limbo between having been read and being added to the
>> buffer. Then on decoding the subsequent block, the initial LF does not trip
>> the normal CRLF decoding, so it is put into the buffer.
>>     
>
> Wouldn't that mean that, on writing the buffer, the file would end
> with extra CRs, instead of missing LFs?
>   
The CRs are effectively stripped on reading, since they end up in limbo 
between being read and being added to the decoding buffer. I haven't 
tried writing the file, but I think (from memory and from the way the 
code looks to me) the problem is a missing CR, not a missing LF.





This bug report was last modified 16 years and 128 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.