Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#721 closed defect (fixed)

parley seems to drop newlines when piping input from stdin

Reported by: Alan Post Owned by: Christian Kellermann
Priority: major Milestone: 4.9.0
Component: extensions Version: 4.7.x
Keywords: parley stdin pasting Cc:
Estimated difficulty:

Description (last modified by Christian Kellermann)

The following program:

(let ((file (read-string)))
  (write file))

is a simple test of read-string. The following does not produce the result I expect:

$ csi test.scm < test.scm
"(let ((file (read-string)))  (write file))\n"

It appears if the newline in the middle of the file is not being preserved? Further, if I remove the "\n" from the test.scm file (please find it attached, I used a program called bvi to remove it, most editors will not let you save a file with a missing final newline), I get:

$ dd if=test.scm bs=1 count=42|csi test.scm
"(let ((file (read-string)))\n"

It seems the final line is being dropped! What is going on here? I expect read-string, when not given a size, to return my input file byte-for-byte?

Attachments (1)

test.scm (42 bytes) - added by Alan Post 12 years ago.
test program with final newline removed.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Alan Post

Attachment: test.scm added

test program with final newline removed.

comment:1 Changed 12 years ago by Christian Kellermann

Component: unknownextensions
Description: modified (diff)
Keywords: parley stdin pasting added
Owner: set to Christian Kellermann
Status: newaccepted
Summary: read-string will drop last line if that line does not end with newlineparley seems to drop newlines when piping input from stdin

parley is in use in alan's .csirc, so the problem has been rededicated to parley

comment:2 Changed 12 years ago by Christian Kellermann

Resolution: fixed
Status: acceptedclosed

This issue has been fixed in revision 25468 and should be available in parley 0.6 shortly.

comment:3 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.