diff options
author | Hans Raaf <hara@oderwat.de> | 2015-03-01 01:41:17 +0100 |
---|---|---|
committer | Hans Raaf <hara@oderwat.de> | 2015-03-01 03:35:20 +0100 |
commit | 79ad73574c403df5ba6b0519a34adbc39dac30e8 (patch) | |
tree | d756e66c63ec37caec173680ace7b22200ba8a2a /lib/system/sysio.nim | |
parent | 2df10fc4a60e6c8f7e0b42205dba29988e0a5c06 (diff) | |
download | Nim-79ad73574c403df5ba6b0519a34adbc39dac30e8.tar.gz |
Fix for readAll(stdin) problem on OS X and better anyway.
Diffstat (limited to 'lib/system/sysio.nim')
-rw-r--r-- | lib/system/sysio.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index a05398a09..48adb895d 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -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 |