more efficient fix for #8961
This commit is contained in:
parent
b9dc486db1
commit
9fa477de75
1 changed files with 6 additions and 0 deletions
|
|
@ -149,6 +149,12 @@ proc readLine(f: File, line: var TaintedString): bool =
|
||||||
if sp == 0:
|
if sp == 0:
|
||||||
sp = 80
|
sp = 80
|
||||||
line.string.setLen(sp)
|
line.string.setLen(sp)
|
||||||
|
else:
|
||||||
|
when not defined(nimscript):
|
||||||
|
sp = cint(cast[PGenericSeq](line.string).space)
|
||||||
|
else:
|
||||||
|
line.string.setLen(sp + 1)
|
||||||
|
|
||||||
while true:
|
while true:
|
||||||
# memset to \L so that we can tell how far fgets wrote, even on EOF, where
|
# memset to \L so that we can tell how far fgets wrote, even on EOF, where
|
||||||
# fgets doesn't append an \L
|
# fgets doesn't append an \L
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue