vgamga4xx: updates from Philippe Anel devcons: fix doubled character when typing devsd: used and not set bug [rsc] --rw-rw-r-- M 22963 glenda sys 9489 Mar 29 11:02 sys/src/9/pc/vgamga4xx.c [diffs elided - too long] [diff -c /n/sourcesdump/2006/0329/plan9/sys/src/9/pc/vgamga4xx.c /n/sourcesdump/2006/0330/plan9/sys/src/9/pc/vgamga4xx.c] [rsc] --rw-rw-r-- M 22963 glenda sys 23071 Mar 29 11:01 sys/src/9/port/devcons.c /n/sourcesdump/2006/0329/plan9/sys/src/9/port/devcons.c:393,399 - /n/sourcesdump/2006/0330/plan9/sys/src/9/port/devcons.c:393,399 qiwrite(serialoq, ebuf, p - ebuf); } - void + static void echo(char *buf, int n) { static int ctrlt, pid; /n/sourcesdump/2006/0329/plan9/sys/src/9/port/devcons.c:400,405 - /n/sourcesdump/2006/0330/plan9/sys/src/9/port/devcons.c:400,408 int x; char *e, *p; + if(n == 0) + return; + e = buf+n; for(p = buf; p < e; p++){ switch(*p){ /n/sourcesdump/2006/0329/plan9/sys/src/9/port/devcons.c:548,555 - /n/sourcesdump/2006/0330/plan9/sys/src/9/port/devcons.c:551,560 echo(kbd.ir, kbd.ie-kbd.ir); kbd.ir = kbd.istage; } - echo(kbd.ir, iw-kbd.ir); - kbd.ir = iw; + if(kbd.ir != iw){ + echo(kbd.ir, iw-kbd.ir); + kbd.ir = iw; + } } } /n/sourcesdump/2006/0329/plan9/sys/src/9/port/devcons.c:745,751 - /n/sourcesdump/2006/0330/plan9/sys/src/9/port/devcons.c:750,757 nexterror(); } while(!qcanread(lineq)){ - qread(kbdq, &ch, 1); + if(qread(kbdq, &ch, 1) == 0) + continue; send = 0; if(ch == 0){ /* flush output on rawoff -> rawon */ [rsc] --rw-rw-r-- M 22963 glenda sys 30871 Mar 29 11:02 sys/src/9/port/devsd.c /n/sourcesdump/2006/0329/plan9/sys/src/9/port/devsd.c:506,512 - /n/sourcesdump/2006/0330/plan9/sys/src/9/port/devsd.c:506,512 } if((sdev = sdgetdev(DEV(c->qid))) == nil){ - devdir(c, q, "unavailable", 0, eve, 0, dp); + devdir(c, c->qid, "unavailable", 0, eve, 0, dp); return 1; } more for(;;) loops [rsc] --rw-rw-r-- M 22963 glenda sys 9006 Mar 29 11:03 sys/src/cmd/auth/secureidcheck.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/auth/secureidcheck.c:188,194 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/auth/secureidcheck.c:188,194 b += 16; a = &resp->first; a->type = 0; - while(1){ + for(;;){ if(b >= e){ a->next = nil; break; // exit loop [rsc] --rw-rw-r-- M 22963 jmk sys 14092 Mar 29 11:02 sys/src/cmd/aux/msexceltables.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/aux/msexceltables.c:467,473 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/aux/msexceltables.c:467,473 ap = gint(b, 4); else ap = 0; - while (1){ + for(;;){ w = (opt & Unicode)? sizeof(Rune): sizeof(char); while(b->len > 0){ [rsc] --rw-rw-r-- M 22963 presotto sys 17927 Mar 29 11:03 sys/src/cmd/trace.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/trace.c:613,619 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/trace.c:613,619 paused = 0; scaleno = 7; /* 100 milliseconds */ now = nsec(); - while(1) { + for(;;) { Alt a[] = { { mousectl->c, nil, CHANRCV }, { mousectl->resizec, nil, CHANRCV }, missing return statements [rsc] --rw-rw-r-- M 22963 rsc sys 9728 Mar 29 17:17 sys/src/cmd/aquarela/smbbuffer.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/aquarela/smbbuffer.c:401,406 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/aquarela/smbbuffer.c:401,407 b->rn += 8; return 1; } + return 0; } ulong [rsc] --rw-rw-r-- M 22963 glenda sys 5965 Mar 29 17:17 sys/src/cmd/aux/acidleak.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/aux/acidleak.c:102,107 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/aux/acidleak.c:102,108 } if(0 <= lo && lo < ndata) return &data[lo]; + return nil; } int nmark; [rsc] --rw-rw-r-- M 22963 rsc sys 11172 Mar 29 17:17 sys/src/cmd/aux/disksim.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/aux/disksim.c:430,436 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/aux/disksim.c:430,435 dirty(offset, blk); tot += n; } - next: /* full and right fringe blocks */ while(tot < count){ blk = getblock(offset+tot, r->ifcall.type==Twrite && nonzero); [rsc] --rw-rw-r-- M 22963 glenda sys 17182 Mar 29 17:16 sys/src/cmd/cdfs/mmc.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/cdfs/mmc.c:561,566 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/cdfs/mmc.c:561,567 if(mmcsetpage(drive, 0x05, p) < 0) return -1; + return 0; } static long [rsc] --rw-rw-r-- M 22963 glenda sys 7466 Mar 29 17:16 sys/src/cmd/ip/dhcpd/db.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/ip/dhcpd/db.c:111,119 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/ip/dhcpd/db.c:111,117 return fd; } } - if(tries >= 5) - return -1; - + return -1; } void [rsc] --rw-rw-r-- M 22963 glenda sys 11077 Mar 29 17:16 sys/src/cmd/upas/send/message.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/upas/send/message.c:118,123 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/upas/send/message.c:118,124 for(; p; p = p->next) if(p->s && p->addr) return s_copy(s_to_c(p->s)); + return nil; } /* get the text of a header line minus the field name */ [rsc] --rw-rw-r-- M 22963 glenda sys 6961 Mar 29 17:16 sys/src/cmd/upas/smtp/smtpd.y /n/sourcesdump/2006/0329/plan9/sys/src/cmd/upas/smtp/smtpd.y:296,301 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/upas/smtp/smtpd.y:296,302 } } else return rv; + return rv; } void [rsc] --rw-rw-r-- M 22963 rsc sys 2864 Mar 29 17:16 sys/src/cmd/ext2srv/iobuf.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/ext2srv/iobuf.c:137,148 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/ext2srv/iobuf.c:137,149 /*chat("xread %d,%d...", dev->dev, addr);*/ seek(dev->dev, (vlong)addr*dev->block_size, 0); - if( read(dev->dev, p->iobuf, dev->block_size) != dev->block_size){ + if(read(dev->dev, p->iobuf, dev->block_size) != dev->block_size){ chat("xread %d, block=%d failed ...", dev->dev, addr); errno = Eio; return -1; } /*chat("xread ok...");*/ + return 0; } void xwrite(Iobuf *p) [rsc] --rw-rw-r-- M 22963 glenda sys 1048 Mar 29 17:56 sys/src/cmd/tcs/conv.h /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/conv.h:13,18 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/conv.h:13,20 void uksc_out(Rune *base, int n, long *notused); void html_in(int fd, long *notused, struct convert *out); void html_out(Rune *base, int n, long *notused); + void tune_in(int fd, long *notused, struct convert *out); + void tune_out(Rune *base, int n, long *notused); #define emit(x) *(*r)++ = (x) #define NRUNE 65536 [rsc] --rw-rw-r-- M 22963 glenda sys 2839 Mar 29 17:57 sys/src/cmd/tcs/conv_big5.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/conv_big5.c:110,115 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/conv_big5.c:110,116 big5proc(-1, &r, nin); if(r > ob) OUT(out, ob, r-ob); + OUT(out, ob, 0); } void [rsc] --rw-rw-r-- M 22963 glenda sys 2228 Mar 29 17:57 sys/src/cmd/tcs/conv_gb.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/conv_gb.c:88,93 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/conv_gb.c:88,94 gbproc(-1, &r, nin); if(r > ob) OUT(out, ob, r-ob); + OUT(out, ob, 0); } void [rsc] --rw-rw-r-- M 22963 glenda sys 11016 Mar 29 17:57 sys/src/cmd/tcs/conv_jis.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/conv_jis.c:363,368 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/conv_jis.c:363,369 (*procfn)(-1, &r, nin); if(r > ob) OUT(out, ob, r-ob); + OUT(out, ob, 0); } void [rsc] --rw-rw-r-- M 22963 glenda sys 2734 Mar 29 17:57 sys/src/cmd/tcs/conv_ksc.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/conv_ksc.c:109,114 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/conv_ksc.c:109,115 ukscproc(-1, &r, nin); if(r > ob) OUT(out, ob, r-ob); + OUT(out, ob, 0); } void [rsc] --rw-rw-r-- M 22963 rsc sys 7338 Mar 29 17:57 sys/src/cmd/tcs/html.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/html.c:424,429 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/html.c:424,430 } if(r > rbuf) OUT(out, rbuf, r-rbuf); + OUT(out, rbuf, 0); } /* [rsc] --rw-rw-r-- M 22963 glenda sys 601 Mar 29 17:57 sys/src/cmd/tcs/mkfile /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/mkfile:11,17 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/mkfile:11,18 kuten208.$O\ gb.$O\ ksc.$O\ - big5.$O + big5.$O\ + tune.$O BIN=/$objtype/bin > 28) & 1; switch(cond) { - case 0: return z; - case 1: return !z; - case 2: return c; - case 3: return !c; - case 4: return n; - case 5: return !n; - case 6: return v; - case 7: return !v; - case 8: return c && !z; - case 9: return !c || z; - case 10: return n == v; - case 11: return n != v; - case 12: return !z && (n == v); - case 13: return z && (n != v); - case 14: return 1; - case 15: return 0; + default: + case 0: return z; + case 1: return !z; + case 2: return c; + case 3: return !c; + case 4: return n; + case 5: return !n; + case 6: return v; + case 7: return !v; + case 8: return c && !z; + case 9: return !c || z; + case 10: return n == v; + case 11: return n != v; + case 12: return !z && (n == v); + case 13: return z && (n != v); + case 14: return 1; + case 15: return 0; } } /n/sourcesdump/2006/0329/plan9/sys/src/libmach/5db.c:510,515 - /n/sourcesdump/2006/0330/plan9/sys/src/libmach/5db.c:511,517 v = rget(map, buf); switch((i->w & BITS(4, 6)) >> 4) { + default: case 0: /* LSLIMM */ return v << s; case 1: /* LSLREG */ /n/sourcesdump/2006/0329/plan9/sys/src/libmach/5db.c:586,595 - /n/sourcesdump/2006/0330/plan9/sys/src/libmach/5db.c:588,598 nb = nbits(i->w & ((1 << 15) - 1)); switch((i->w >> 23) & 3) { - case 0: return (v - (nb*4)) + 4; - case 1: return v; - case 2: return v - (nb*4); - case 3: return v + 4; + default: + case 0: return (v - (nb*4)) + 4; + case 1: return v; + case 2: return v - (nb*4); + case 3: return v + 4; } } [rsc] --rw-rw-r-- M 22963 glenda sys 50716 Mar 29 17:34 sys/src/libsec/port/x509.c /n/sourcesdump/2006/0329/plan9/sys/src/libsec/port/x509.c:2437,2469 - /n/sourcesdump/2006/0330/plan9/sys/src/libsec/port/x509.c:2437,2469 if(tag.class != Universal) return smprint("class%d,num%d", tag.class, tag.num); switch(tag.num){ - case BOOLEAN: return "BOOLEAN"; break; - case INTEGER: return "INTEGER"; break; - case BIT_STRING: return "BIT STRING"; break; - case OCTET_STRING: return "OCTET STRING"; break; - case NULLTAG: return "NULLTAG"; break; - case OBJECT_ID: return "OID"; break; - case ObjectDescriptor: return "OBJECT_DES"; break; - case EXTERNAL: return "EXTERNAL"; break; - case REAL: return "REAL"; break; - case ENUMERATED: return "ENUMERATED"; break; - case EMBEDDED_PDV: return "EMBEDDED PDV"; break; - case SEQUENCE: return "SEQUENCE"; break; - case SETOF: return "SETOF"; break; - case NumericString: return "NumericString"; break; - case PrintableString: return "PrintableString"; break; - case TeletexString: return "TeletexString"; break; - case VideotexString: return "VideotexString"; break; - case IA5String: return "IA5String"; break; - case UTCTime: return "UTCTime"; break; - case GeneralizedTime: return "GeneralizedTime"; break; - case GraphicString: return "GraphicString"; break; - case VisibleString: return "VisibleString"; break; - case GeneralString: return "GeneralString"; break; - case UniversalString: return "UniversalString"; break; - case BMPString: return "BMPString"; break; - default: - return smprint("Universal,num%d", tag.num); + case BOOLEAN: return "BOOLEAN"; + case INTEGER: return "INTEGER"; + case BIT_STRING: return "BIT STRING"; + case OCTET_STRING: return "OCTET STRING"; + case NULLTAG: return "NULLTAG"; + case OBJECT_ID: return "OID"; + case ObjectDescriptor: return "OBJECT_DES"; + case EXTERNAL: return "EXTERNAL"; + case REAL: return "REAL"; + case ENUMERATED: return "ENUMERATED"; + case EMBEDDED_PDV: return "EMBEDDED PDV"; + case SEQUENCE: return "SEQUENCE"; + case SETOF: return "SETOF"; + case NumericString: return "NumericString"; + case PrintableString: return "PrintableString"; + case TeletexString: return "TeletexString"; + case VideotexString: return "VideotexString"; + case IA5String: return "IA5String"; + case UTCTime: return "UTCTime"; + case GeneralizedTime: return "GeneralizedTime"; + case GraphicString: return "GraphicString"; + case VisibleString: return "VisibleString"; + case GeneralString: return "GeneralString"; + case UniversalString: return "UniversalString"; + case BMPString: return "BMPString"; + default: + return smprint("Universal,num%d", tag.num); } } [rsc] --rw-rw-r-- M 22963 glenda sys 1163 Mar 29 18:15 sys/src/libString/s_getline.c /n/sourcesdump/2006/0329/plan9/sys/src/libString/s_getline.c:68,72 - /n/sourcesdump/2006/0330/plan9/sys/src/libString/s_getline.c:68,71 } c = Bgetc(fp); } - return 0; } tcs: fix UTF-near-EOF bug and add TUNE encoding [rsc] --rw-rw-r-- M 22963 glenda sys 7975 Mar 29 17:57 sys/src/cmd/tcs/utf.c /n/sourcesdump/2006/0329/plan9/sys/src/cmd/tcs/utf.c:37,43 - /n/sourcesdump/2006/0330/plan9/sys/src/cmd/tcs/utf.c:37,43 tot = 0; while((n = read(fd, buf+tot, N-tot)) >= 0){ tot += n; - for(i=j=0; i + #include #include int uname(struct utsname *n) { - n->sysname = "Plan9"; + char *osname; + + n->sysname = getenv("osname"); + if(!n->sysname) + osname = "Plan9"; n->nodename = getenv("sysname"); if(!n->nodename){ n->nodename = getenv("site"); /n/sourcesdump/2006/0329/plan9/sys/src/ape/lib/ap/plan9/uname.c:11,23 - /n/sourcesdump/2006/0330/plan9/sys/src/ape/lib/ap/plan9/uname.c:16,27 if(!n->nodename) n->nodename = "?"; } - n->release = "1"; + n->release = "4"; /* edition */ n->version = "0"; - n->machine = getenv("terminal"); - if(!n->machine){ - n->machine = getenv("cputype"); - if(!n->machine) - n->machine = "?"; - } + n->machine = getenv("cputype"); + if(!n->machine) + n->machine = "?"; + if(strcmp(n->machine, "386") == 0) + n->machine = "i386"; /* for gnu configure */ return 0; }