From 43404fc913cc8e0792d165eccc9cd6b637dbbbd0 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 6 Feb 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-02-06 --- pc/devvga.c | 25 ++++++++++++++----------- port/devmnt.c | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pc/devvga.c b/pc/devvga.c index 32afe2f2c9bfdb26ad24e999cfad5c3a8b54aa39..72234657d439ac14b4735b37e08dbb9575b64daf 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -272,26 +272,29 @@ vgactl(char *arg) } } else if(strcmp(field[0], "size") == 0){ - if((x = strtoul(field[1], &cp, 0)) == 0 || x > 2048) + x = strtoul(field[1], &cp, 0); + if(x == 0 || x > 2048) error(Ebadarg); if(*cp) cp++; - if((y = strtoul(cp, &cp, 0)) == 0 || y > 1280) + y = strtoul(cp, &cp, 0); + if(y == 0 || y > 1280) error(Ebadarg); if(*cp) cp++; - if((z = strtoul(cp, &cp, 0)) == 1) - z = 0; - else if(z == 8) - z = 3; - else + switch(strtoul(cp, &cp, 0)){ + case 8: + z = 3; break; + case 1: + z = 0; break; + default: error(Ebadarg); + } interlaced[0] = *cp; - if(cga == 0) - cursoroff(1); + cursoroff(1); setscreen(x, y, z); cursoron(1); return; @@ -765,7 +768,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock) ulong off; uchar *q, *e; - if(!rectclip(&r, gscreen.r) || tl<=0) + if(cga || !rectclip(&r, gscreen.r) || tl<=0) return; if(dolock && hwgc == 0) @@ -922,7 +925,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock) ulong off; uchar *q, *e; - if(!rectclip(&r, gscreen.r) || tl<=0) + if(cga || !rectclip(&r, gscreen.r) || tl<=0) return; if(dolock && hwgc == 0) diff --git a/port/devmnt.c b/port/devmnt.c index fa5d7be1fef98438e4ce2ef60f900a65066178ca..a752fb7c8b574b5c126cad863b865b571146e73e 100644 --- a/port/devmnt.c +++ b/port/devmnt.c @@ -602,7 +602,7 @@ mntrdwr(int type, Chan *c, void *buf, long n, ulong offset) uba = buf; cnt = 0; cache = c->flag & CCACHE; - if(c->path & CHDIR) + if(c->qid.path & CHDIR) cache = 0; for(;;) { r = mntralloc(c);