changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: merge

changeset 6839: 30fdf5a6055d
parent 6837: 8773a350600f
parent 6838: df82b64341f1
child 6840: c927ec087782
author: cinap_lenrek@felloff.net
date: Sun, 21 Oct 2018 03:44:16 +0200
files:
description: merge
     1.1--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
     1.2+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
     1.3@@ -625,23 +625,29 @@ consproc(void *)
     1.4 	p = buf;
     1.5 	e = buf + sizeof(buf);
     1.6 	while((n = read(consfd, p, e - p)) > 0){
     1.7-		x = buf + n;
     1.8-		while(p < x && fullrune(p, x - p)){
     1.9+		x = p + n;
    1.10+		p = buf;
    1.11+		while((n = x - p) > 0){
    1.12+			if(!fullrune(p, n)){
    1.13+				memmove(buf, p, n);
    1.14+				break;
    1.15+			}
    1.16 			p += chartorune(&r, p);
    1.17-			if(r){
    1.18-				if(r == 021 || r == 023)	/* XON/XOFF */
    1.19-					continue;
    1.20-				if(r == '\n' && cr){
    1.21-					cr = 0;
    1.22-					continue;
    1.23-				}
    1.24-				if(cr = (r == '\r'))
    1.25-					r = '\n';
    1.26-				send(runechan, &r);
    1.27+			if(r == 021 || r == 023)	/* XON/XOFF */
    1.28+				continue;
    1.29+			if(r == 0 || r == Runeerror){
    1.30+				cr = 0;
    1.31+				continue;
    1.32 			}
    1.33+			if(r == '\n' && cr){
    1.34+				cr = 0;
    1.35+				continue;
    1.36+			}
    1.37+			if(cr = (r == '\r'))
    1.38+				r = '\n';
    1.39+			send(runechan, &r);
    1.40 		}
    1.41-		n = x - p;
    1.42-		memmove(buf, p, n);
    1.43+		if(n < 0) n = 0;
    1.44 		p = buf + n;
    1.45 	}
    1.46