From dfaa63e80527da55771ac983558c4e267e62f890 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 7 Oct 2015 09:38:45 +0200 Subject: [PATCH] osproc: fixes a long standing buffering bug on Windows --- lib/pure/osproc.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index c23126be91..fa20afff03 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -363,7 +363,7 @@ when defined(Windows) and not defined(useNimRtl): # TRUE and n (>0) bytes returned (good data). # FALSE and bytes returned undefined (system error). if a == 0 and br != 0: raiseOSError(osLastError()) - s.atTheEnd = br < bufLen + s.atTheEnd = br == 0 #< bufLen result = br proc hsWriteData(s: Stream, buffer: pointer, bufLen: int) =