diff options
author | Ganesh Viswanathan <dev@genotrance.com> | 2018-09-15 14:33:47 -0500 |
---|---|---|
committer | Ganesh Viswanathan <dev@genotrance.com> | 2018-09-15 14:33:47 -0500 |
commit | 9fc0a9ad420876ba9548aa56d4120d6b9bd3a282 (patch) | |
tree | 8c31ac5d33be117876bf4577b6ca0e76be512b4d /lib/system/sysio.nim | |
parent | 9340885251e7791ee5a03f2b75e168f341e231e5 (diff) | |
parent | 0e33a8676e325fa4174893291ed41d59b689c577 (diff) | |
download | Nim-9fc0a9ad420876ba9548aa56d4120d6b9bd3a282.tar.gz |
Merge remote-tracking branch 'upstream/devel' into test-7010
Diffstat (limited to 'lib/system/sysio.nim')
-rw-r--r-- | lib/system/sysio.nim | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index df13ab628..61835e0f7 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -145,10 +145,9 @@ 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) + 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 # fgets doesn't append an \L |