Merge pull request #2238 from oderwat/fix-2228-readall-osx
Fix for readAll(stdin) problem on OS X and better anyway. I can confirm this works on Windows.
This commit is contained in:
commit
8b05bf3e86
1 changed files with 2 additions and 2 deletions
|
|
@ -145,8 +145,8 @@ proc readAllFile(file: File): string =
|
|||
proc readAll(file: File): TaintedString =
|
||||
# Separate handling needed because we need to buffer when we
|
||||
# don't know the overall length of the File.
|
||||
var len = rawFileSize(file)
|
||||
if len >= 0:
|
||||
let len = if file != stdin: rawFileSize(file) else: -1
|
||||
if len > 0:
|
||||
result = readAllFile(file, len).TaintedString
|
||||
else:
|
||||
result = readAllBuffer(file).TaintedString
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue