From 78439d25f8b2f6f2289e9f4e4400e0f7cdb5fa70 Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 12 Jan 2007 15:57:34 +0000 Subject: Fix 15-year-old sam protocol bug. --- src/cmd/sam/rasp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/cmd/sam/rasp.c') diff --git a/src/cmd/sam/rasp.c b/src/cmd/sam/rasp.c index 829a7b49..5a691129 100644 --- a/src/cmd/sam/rasp.c +++ b/src/cmd/sam/rasp.c @@ -3,7 +3,7 @@ * GROWDATASIZE must be big enough that all errors go out as Hgrowdata's, * so they will be scrolled into visibility in the ~~sam~~ window (yuck!). */ -#define GROWDATASIZE 50 /* if size is > this, send data with grow */ +#define GROWDATASIZE 50 /* if size is <= this, send data with grow */ void rcut(List*, Posn, Posn); int rterm(List*, Posn); @@ -79,6 +79,20 @@ raspdone(File *f, int toterm) } } +void +raspflush(File *f) +{ + if(grown){ + outTsll(Hgrow, f->tag, growpos, grown); + grown = 0; + } + else if(shrunk){ + outTsll(Hcut, f->tag, shrinkpos, shrunk); + shrunk = 0; + } + outflush(); +} + void raspdelete(File *f, uint p1, uint p2, int toterm) { @@ -323,3 +337,4 @@ rdata(List *r, Posn p1, Posn n) } return rg; } + -- cgit v1.2.3