~ft/9pro

a82e8034cd0f44560eeb91269e992399700fb86f — Sigrid Haflínudóttir 2 months ago a0194e7 master
strip control chars
1 files changed, 14 insertions(+), 1 deletions(-)

M 9gc.c
M 9gc.c => 9gc.c +14 -1
@@ 153,6 153,19 @@ dial(char *s)
}

static void
output(uint8_t *d, int sz)
{
	int i, j;

	for (i = j = 0; i < sz; i++) {
		d[j] = d[i];
		if (d[j] > 31 || d[j] == '\t' || d[j] == '\n')
			j++;
	}
	write(1, d, j);
}

static void
ctxchatR(C9ctx *ctx, C9r *r)
{
	C9aux *a;


@@ 172,7 185,7 @@ ctxchatR(C9ctx *ctx, C9r *r)

	case Rread:
		if (chatoff >= skipuntil)
			write(1, r->read.data, r->read.size);
			output(r->read.data, r->read.size);
		chatoff += r->read.size;
		/* fallthrough */
	case Ropen: