shithub: riscv

Download patch

ref: b4eb667f02c32f007290b68adc95c8fbd9a2c3cd
parent: 84e019aba3dd233d817272cc62ca2a95a5263de7
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Oct 20 19:57:50 EDT 2018

acme: fix fd checks - initialize Window.rdselfd to -1 not 0

--- a/sys/src/cmd/acme/cols.c
+++ b/sys/src/cmd/acme/cols.c
@@ -84,6 +84,7 @@
 	}
 	if(w == nil){
 		w = emalloc(sizeof(Window));
+		w->rdselfd = -1;
 		w->col = c;
 		draw(screen, r, textcols[BACK], nil, ZP);
 		wininit(w, clone, r);
--- a/sys/src/cmd/acme/xfid.c
+++ b/sys/src/cmd/acme/xfid.c
@@ -236,7 +236,7 @@
 			break;
 		case QWrdsel:
 			close(w->rdselfd);
-			w->rdselfd = 0;
+			w->rdselfd = -1;
 			break;
 		case QWwrsel:
 			w->nomark = FALSE;