X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=io.lisp;h=d4c50ef6b28a5e93c960558ffc18fbbcf3b4fc55;hb=f21d8902cf098dc991499a76cb290e52d3b4c39c;hp=4dea295f5e789d6dacb1c2eb86fe99c155d71487;hpb=6f333885c716800cf85c2986a3b835efe0e54e70;p=kmrcl.git diff --git a/io.lisp b/io.lisp index 4dea295..d4c50ef 100644 --- a/io.lisp +++ b/io.lisp @@ -9,7 +9,7 @@ ;;;; ;;;; $Id$ ;;;; -;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg +;;;; This file, part of KMRCL, is Copyright (c) 2002-2003 by Kevin M. Rosenberg ;;;; ;;;; KMRCL users are granted the rights to distribute and use this software ;;;; as governed by the terms of the Lisp Lesser GNU Public License @@ -21,12 +21,13 @@ (defun print-file-contents (file &optional (strm *standard-output*)) "Opens a reads a file. Returns the contents as a single string" (when (probe-file file) - (with-open-file (in file :direction :input) - (let ((eof (gensym))) - (do ((line (read-line in nil eof) - (read-line in nil eof))) - ((eq line eof)) - (format strm "~A~%" line)))))) + (let ((eof (cons 'eof nil))) + (with-open-file (in file :direction :input) + (do ((line (read-line in nil eof) + (read-line in nil eof))) + ((eq line eof)) + (write-string line strm) + (write-char #\newline strm)))))) (defun read-file-to-string (file) "Opens a reads a file. Returns the contents as a single string"