lib/niti_runtime: update to reflect not-so-recent changes on eof and readline
authorJean Privat <jean@pryen.org>
Tue, 20 Oct 2015 20:43:21 +0000 (16:43 -0400)
committerJean Privat <jean@pryen.org>
Tue, 20 Oct 2015 20:43:21 +0000 (16:43 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

lib/niti_runtime.nit

index dd6241b..198f3a8 100644 (file)
@@ -27,17 +27,10 @@ redef class Sys
        # Read the next useful line from file-name arguments
        private fun read_next_line
        do
-               if stdin.eof then
+               while stdin.eof do
                        open_next_stream
                end
-               var line = stdin.read_line
-               loop
-                       if not stdin.eof then break
-                       open_next_stream
-                       if not line.is_empty then break
-                       line = stdin.read_line
-               end
-               self.line = line
+               self.line = stdin.read_line
        end
 
        # Open the next file until there is no more arguments
@@ -49,5 +42,5 @@ redef class Sys
        end
 
        # The next line to process by the main program
-       var line: String
+       var line: String is noautoinit
 end