shithub: mc

Download patch

ref: c92d7552d23497a2e5d6d813e8ed35c612c7dcb3
parent: e414e8418b0ca9dd8d49894d96ef37b12276da16
author: Ori Bernstein <[email protected]>
date: Mon Sep 29 09:55:12 EDT 2014

Only succeed blatting if we write the whole buffer.

    Writing without error isn't quite the right condition.

--- a/libstd/blat.myr
+++ b/libstd/blat.myr
@@ -23,11 +23,13 @@
 	n = 0
 	while true
 		written = write(fd, buf[n:])
-		if written <= 0
+		if written == 0
 			goto done
+		elif written < 0
+			goto fail
 		;;
 		n += written
 	;;
 :done
-	-> written == 0
+	-> written == 0 && n == buf.len
 }