mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 19:52:36 +00:00
more efficient fix for #8961
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user