From 79ad73574c403df5ba6b0519a34adbc39dac30e8 Mon Sep 17 00:00:00 2001 From: Hans Raaf Date: Sun, 1 Mar 2015 01:41:17 +0100 Subject: Fix for readAll(stdin) problem on OS X and better anyway. --- lib/system/sysio.nim | 4 ++-- 1 file 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 -- cgit 1.4.1-2-gfad0