Subject: bug#1035 closed by Jason Rumney <[email-masked]> (Re: bug#1035: 23.0.60; DOS eol decoding bug)

From: [email-masked] (Emacs bug Tracking System)
Date: Sat, 20 Dec 2008 08:10:07 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1035: 23.0.60; DOS eol decoding bug

It has been closed by Jason Rumney <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Jason Rumney <[email-masked]> by
replying to this email.

-- 
1035: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1035
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#1035: 23.0.60; DOS eol decoding bug
From: Jason Rumney <[email-masked]>
To: Johan Bockgård <[email-masked]>, [email-masked]
Date: Sat, 20 Dec 2008 16:02:54 +0800

Johan Bockgård wrote:
> Decoding a chunk of DOS text that ends in \r results in an extra chunk
> of garbage.
>   

Thanks for reporting it, I have fixed this now.

>From [email-masked] Fri Sep 26 13:34:26 2008
From: [email-masked] (Johan =?utf-8?Q?Bockg=C3=A5rd?=)
To: [email-masked]
Subject: 23.0.60; DOS eol decoding bug
Date: Fri, 26 Sep 2008 22:34:12 +0200

Decoding a chunk of DOS text that ends in \r results in an extra chunk
of garbage.

    (progn
      (with-temp-file "/tmp/bar"
        (insert-char ?x 10)
        (insert "\r"))
      (with-temp-buffer
        (let ((coding-system-for-read 'raw-text-dos))
          (insert-file-contents "/tmp/bar")
          (buffer-size))))

      =3D> 21 (expected result 11)

I think the problem was introduced with this change:

2008-03-02  Kenichi Handa  <[email-masked]>

    * coding.c (decode_coding_utf_8): When eol-type of CODING is `dos',
    don't decode '\r' if that is the last in the source.
    (decode_coding_utf_16, decode_coding_emacs_mule)
    (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
    (decode_coding_raw_text, decode_coding_charset): Likewise.
    (produce_chars): Don't decode EOL here. Use EMACS_INT.

--=20
Johan Bockg=C3=A5rd