From: cinap_lenrek Date: Sat, 20 Oct 2018 21:57:50 +0000 (+0200) Subject: acme: fix fd checks - initialize Window.rdselfd to -1 not 0 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=b4eb667f02c32f007290b68adc95c8fbd9a2c3cd;hp=84e019aba3dd233d817272cc62ca2a95a5263de7;p=plan9front.git acme: fix fd checks - initialize Window.rdselfd to -1 not 0 --- diff --git a/sys/src/cmd/acme/cols.c b/sys/src/cmd/acme/cols.c index 386233d30..a5e0fbd28 100644 --- a/sys/src/cmd/acme/cols.c +++ b/sys/src/cmd/acme/cols.c @@ -84,6 +84,7 @@ coladd(Column *c, Window *w, Window *clone, int y) } if(w == nil){ w = emalloc(sizeof(Window)); + w->rdselfd = -1; w->col = c; draw(screen, r, textcols[BACK], nil, ZP); wininit(w, clone, r); diff --git a/sys/src/cmd/acme/xfid.c b/sys/src/cmd/acme/xfid.c index 38db4acd0..2a8e17bdb 100644 --- a/sys/src/cmd/acme/xfid.c +++ b/sys/src/cmd/acme/xfid.c @@ -236,7 +236,7 @@ xfidclose(Xfid *x) break; case QWrdsel: close(w->rdselfd); - w->rdselfd = 0; + w->rdselfd = -1; break; case QWwrsel: w->nomark = FALSE;