shithub: mc

Download patch

ref: 35ae688b88cdb8952a456f0794af576773613907
parent: b33507bdac290ffd2792dafeb7b73f81cb4cda8d
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Oct 4 19:12:25 EDT 2015

Drop buffer on flush error.

    We don't want to end up with the buffers left while in an error
    state.

--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -246,13 +246,11 @@
 	ret = true
 	if f.mode & Wr != 0
 		match writebuf(f.fd, f.wbuf[:f.wend])
-		| `Ok n:
-			ret = (n == f.wend)
-			f.wend = 0
-		| _:
-			-> false
+		| `Ok n: ret = (n == f.wend)
+		| _:	ret = false
 		;;
 	;;
+	f.wend = 0
 	-> ret
 }