summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system/sysio.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim
index df13ab628..672d0e0f1 100644
--- a/lib/system/sysio.nim
+++ b/lib/system/sysio.nim
@@ -149,6 +149,12 @@ proc readLine(f: File, line: var TaintedString): bool =
   if sp == 0:
     sp = 80
     line.string.setLen(sp)
+  else:
+    when not defined(nimscript):
+      sp = cint(cast[PGenericSeq](line.string).space)
+    else:
+      line.string.setLen(sp + 1)
+
   while true:
     # memset to \L so that we can tell how far fgets wrote, even on EOF, where
     # fgets doesn't append an \L