Merge pull request #8972 from skilchen/more_efficient_fix_for_8961
more efficient fix for #8961
This commit is contained in:
commit
2745111fc3
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue