bug in read-lines: skips empty lines

Ralf Juengling <[email protected]> Mon, 13 Feb 2006 09:10:18 -0800 (PST)
Newsgroups gmane.lisp.lush.devel
Message-ID <[email protected]>
read-lines should return an empty string for an empty line.
Here is a fix that works on a unix platform:

--- orig/lsh/libc/shell.lsh
+++ mod/lsh/libc/shell.lsh
@@ -75,8 +75,9 @@
  (de read-lines(f)
    (reading f
      (let ((ans ()))
-      (while (<> (skip-char "\n\r\f") "\e")
-        (setq ans (cons (read-string) ans)))
+      (while (<> (skip-char "") "\e")
+        (setq ans (cons (read-string) ans))
+       (read-string 1)) ;; need a function 'read-newline' here
        (reverse ans))))

Ralf



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642