about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buffer/buffer.nim4
-rw-r--r--src/css/cssparser.nim5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim
index 5d69325f..d28ebbb0 100644
--- a/src/buffer/buffer.nim
+++ b/src/buffer/buffer.nim
@@ -1107,8 +1107,8 @@ proc runBuffer(buffer: Buffer, rfd: int) =
           if event.fd == rfd:
             try:
               buffer.readCommand()
-            except IOError:
-              #eprint "ERROR IN BUFFER", $buffer.location & "\nMESSAGE:",
+            except EOFError:
+              #eprint "EOF error", $buffer.location & "\nMESSAGE:",
               #       getCurrentExceptionMsg() & "\n",
               #       getStackTrace(getCurrentException())
               break loop
diff --git a/src/css/cssparser.nim b/src/css/cssparser.nim
index b4a22e28..29f88151 100644
--- a/src/css/cssparser.nim
+++ b/src/css/cssparser.nim
@@ -482,7 +482,10 @@ proc consumeToken(state: var CSSTokenizerState): CSSToken =
 proc tokenizeCSS*(inputStream: Stream): seq[CSSParsedItem] =
   var state: CSSTokenizerState
   state.stream = inputStream
-  state.buf = state.stream.readLine() & '\n'
+  try:
+    state.buf = state.stream.readStr(256)
+  except EOFError:
+    discard
   while state.has():
     let tok = state.consumeToken()
     if tok != nil: