Opened 13 years ago

Last modified 12 years ago

#721 closed defect

parley seems to drop newlines when piping input from stdin — at Version 1

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?

Change History (2)

Changed 13 years ago by Alan Post

Attachment: test.scm added

test program with final newline removed.

comment:1 Changed 13 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

Note: See TracTickets for help on using tickets.