r8844: laptop updates
[kmrcl.git] / io.lisp
diff --git a/io.lisp b/io.lisp
index 4dea295f5e789d6dacb1c2eb86fe99c155d71487..d4c50ef6b28a5e93c960558ffc18fbbcf3b4fc55 100644 (file)
--- 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
 (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"