diff options
author | skilchen <skilchen@bluewin.ch> | 2018-09-15 14:05:42 +0200 |
---|---|---|
committer | skilchen <skilchen@bluewin.ch> | 2018-09-15 14:05:42 +0200 |
commit | e317745098b95418bc1bc3d76b930ab197d67110 (patch) | |
tree | 732ba3da739d3617aa86edbc8393323d16c9612b | |
parent | 9fa477de755daf76c6a2302f58553d10caa061e9 (diff) | |
download | Nim-e317745098b95418bc1bc3d76b930ab197d67110.tar.gz |
don't reuse code from 0.18.0
-rw-r--r-- | lib/system/sysio.nim | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index 672d0e0f1..61835e0f7 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -145,15 +145,8 @@ proc readLine(f: File, line: var TaintedString): bool = var pos = 0 # Use the currently reserved space for a first try - var sp = line.string.len - 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) + var sp = max(line.string.len, 80) + line.string.setLen(sp) while true: # memset to \L so that we can tell how far fgets wrote, even on EOF, where |