chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Treat lone carriage returns as line ending


From: Peter Bex
Subject: Re: [Chicken-hackers] [PATCH] Treat lone carriage returns as line endings in ##sys#scan-buffer-line
Date: Thu, 31 Oct 2013 19:18:18 +0100
User-agent: Mutt/1.4.2.3i

On Thu, Oct 31, 2013 at 08:59:24PM +1300, Evan Hanson wrote:
> Hi all,
> 
> Here are two small patches around `read-line`. The first just removes
> some dead code in extras' definition of the procedure, while the second
> fixes #1004 by making `##sys#scan-buffer-line` treat lone carriage
> returns as line terminators. This resolves the difference in behavior
> Moritz noted in that ticket, where:
> 
>     (with-input-from-string "foo\rbar" read-line) ; => "foo\rbar"
> 
> ... While reading the same from a file, for example, gives:
> 
>     (with-input-from-file "foo-bar.txt" read-line) ; => "foo"
> 
> I think this normalizes CR/LF handling for `read-line` across all the
> port types (though interestingly it doesn't make it quite
> R7RS-compatible, since that specifies that multiple carriage returns
> should be collapsed when followed by a linefeed, rather than just one).

Ah, very good!

I have nothing to comment on this, so I'm just attaching them as-is,
plus a signed-off-by line, so the next guy can just sign it off and
push. :)

Thanks!

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Remove-unused-procedure-definition-in-extras-read-li.patch
Description: Text document

Attachment: 0002-Treat-lone-carriage-returns-as-line-endings-in-sys-s.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]