diff options
author | skilchen <skilchen@bluewin.ch> | 2018-09-15 01:04:23 +0200 |
---|---|---|
committer | skilchen <skilchen@bluewin.ch> | 2018-09-15 01:04:23 +0200 |
commit | 9fa477de755daf76c6a2302f58553d10caa061e9 (patch) | |
tree | 95bf2bd58c597a6298f51e9be123f5eb3cde236a | |
parent | b9dc486db15bb1b4b6f3cef7626733b904d377f7 (diff) | |
download | Nim-9fa477de755daf76c6a2302f58553d10caa061e9.tar.gz |
more efficient fix for #8961
-rw-r--r-- | lib/system/sysio.nim | 6 |
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 |