[Top][All Lists]

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

[Chicken-hackers] [PATCH] Treat lone carriage returns as line endings in

From: Evan Hanson
Subject: [Chicken-hackers] [PATCH] Treat lone carriage returns as line endings in ##sys#scan-buffer-line
Date: Thu, 31 Oct 2013 20:59:24 +1300
User-agent: OpenSMTPD enqueuer (Demoosh)

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).



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]