Fix for readAll(stdin) problem on OS X and better anyway.
This commit is contained in:
parent
2df10fc4a6
commit
79ad73574c
1 changed files with 2 additions and 2 deletions
|
|
@ -145,8 +145,8 @@ proc readAllFile(file: File): string =
|
||||||
proc readAll(file: File): TaintedString =
|
proc readAll(file: File): TaintedString =
|
||||||
# Separate handling needed because we need to buffer when we
|
# Separate handling needed because we need to buffer when we
|
||||||
# don't know the overall length of the File.
|
# don't know the overall length of the File.
|
||||||
var len = rawFileSize(file)
|
let len = if file != stdin: rawFileSize(file) else: -1
|
||||||
if len >= 0:
|
if len > 0:
|
||||||
result = readAllFile(file, len).TaintedString
|
result = readAllFile(file, len).TaintedString
|
||||||
else:
|
else:
|
||||||
result = readAllBuffer(file).TaintedString
|
result = readAllBuffer(file).TaintedString
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue