diff options
Diffstat (limited to 'appl')
| -rw-r--r-- | appl/cmd/archfs.b | 2 | ||||
| -rw-r--r-- | appl/cmd/auth/changelogin.b | 1 | ||||
| -rw-r--r-- | appl/cmd/auth/keysrv.b | 4 | ||||
| -rw-r--r-- | appl/cmd/auth/passwd.b | 4 | ||||
| -rw-r--r-- | appl/cmd/cpu.b | 2 | ||||
| -rw-r--r-- | appl/cmd/dbfs.b | 2 | ||||
| -rw-r--r-- | appl/cmd/env.b | 3 | ||||
| -rw-r--r-- | appl/cmd/gzip.b | 2 | ||||
| -rw-r--r-- | appl/cmd/itest.b | 8 | ||||
| -rw-r--r-- | appl/cmd/itreplay.b | 2 | ||||
| -rw-r--r-- | appl/cmd/logfile.b | 4 | ||||
| -rw-r--r-- | appl/cmd/mdb.b | 202 | ||||
| -rw-r--r-- | appl/cmd/memfs.b | 6 | ||||
| -rw-r--r-- | appl/cmd/mkdir.b | 2 | ||||
| -rw-r--r-- | appl/cmd/mntgen.b | 2 | ||||
| -rw-r--r-- | appl/cmd/mouse.b | 4 | ||||
| -rw-r--r-- | appl/cmd/mv.b | 1 | ||||
| -rw-r--r-- | appl/cmd/ramfile.b | 4 | ||||
| -rw-r--r-- | appl/cmd/rcmd.b | 2 | ||||
| -rw-r--r-- | appl/cmd/stack.b | 4 | ||||
| -rw-r--r-- | appl/cmd/stackv.b | 2 | ||||
| -rw-r--r-- | appl/cmd/styxchat.b | 2 | ||||
| -rw-r--r-- | appl/cmd/styxlisten.b | 2 | ||||
| -rw-r--r-- | appl/cmd/tail.b | 4 | ||||
| -rw-r--r-- | appl/cmd/telnet.b | 2 | ||||
| -rw-r--r-- | appl/cmd/tsort.b | 2 | ||||
| -rw-r--r-- | appl/cmd/xmount.b | 2 | ||||
| -rw-r--r-- | appl/cmd/yacc.b | 1 |
28 files changed, 239 insertions, 39 deletions
diff --git a/appl/cmd/archfs.b b/appl/cmd/archfs.b index 11567731..af3b73b9 100644 --- a/appl/cmd/archfs.b +++ b/appl/cmd/archfs.b @@ -125,7 +125,7 @@ init(nil: ref Draw->Context, args: list of string) fatal("can't create pipe"); pidch := chan of int; spawn serve(p[1], pidch); - pid := <- pidch; + <- pidch; if(sys->mount(p[0], nil, mtpt, flags, nil) < 0) fatal(sys->sprint("cannot mount archive on %s: %r", mtpt)); } diff --git a/appl/cmd/auth/changelogin.b b/appl/cmd/auth/changelogin.b index 97141408..f0d84256 100644 --- a/appl/cmd/auth/changelogin.b +++ b/appl/cmd/auth/changelogin.b @@ -206,7 +206,6 @@ getuser(id: string): (string, array of byte, int, string) if(sys->read(fd, secret, len secret) != len secret) return (nil, nil, 0, sys->sprint("error reading %s/secret: %r", id)); } - expiry := 0; fd = sys->open(dbdir+"/expire", Sys->OREAD); if(fd == nil) return (nil, nil, 0, sys->sprint("can't open %s/expiry: %r", id)); diff --git a/appl/cmd/auth/keysrv.b b/appl/cmd/auth/keysrv.b index c7144256..fb0bd9d7 100644 --- a/appl/cmd/auth/keysrv.b +++ b/appl/cmd/auth/keysrv.b @@ -116,7 +116,7 @@ worker(file: ref Sys->FileIO, user: string, exitc: chan of int) for(;;)alt{ <-exitc => exit; - (nil, nbytes, fid, rc) := <-file.read => + (nil, nil, nil, rc) := <-file.read => if(rc == nil) break; if(err != nil){ @@ -124,7 +124,7 @@ worker(file: ref Sys->FileIO, user: string, exitc: chan of int) break; } rc <-= (nil, nil); - (nil, data, fid, wc) := <-file.write => + (nil, data, nil, wc) := <-file.write => if(wc == nil) break; if(err != nil){ diff --git a/appl/cmd/auth/passwd.b b/appl/cmd/auth/passwd.b index d10b5c95..b001cb16 100644 --- a/appl/cmd/auth/passwd.b +++ b/appl/cmd/auth/passwd.b @@ -80,7 +80,7 @@ init(nil: ref Draw->Context, args: list of string) sys->print("key owner: %s\n", ai.mypk.owner); sys->pctl(Sys->FORKNS|Sys->FORKFD, nil); - remid := mountsrv(ai); + mountsrv(ai); # get password ok: int; @@ -224,7 +224,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/cpu.b b/appl/cmd/cpu.b index 57a62fdf..75728e57 100644 --- a/appl/cmd/cpu.b +++ b/appl/cmd/cpu.b @@ -156,7 +156,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/dbfs.b b/appl/cmd/dbfs.b index 9482e8df..3e1e9978 100644 --- a/appl/cmd/dbfs.b +++ b/appl/cmd/dbfs.b @@ -120,7 +120,7 @@ init(nil: ref Draw->Context, args: list of string) df := bufio->open(file, Sys->OREAD); if(df == nil && empty){ - (rc, d) := sys->stat(file); + (rc, nil) := sys->stat(file); if(rc < 0) df = bufio->create(file, Sys->OREAD, 8r600); } diff --git a/appl/cmd/env.b b/appl/cmd/env.b index e6fd8889..d35d13a3 100644 --- a/appl/cmd/env.b +++ b/appl/cmd/env.b @@ -32,8 +32,7 @@ init(nil: ref Draw->Context, argv: list of string) readdir := load Readdir Readdir->PATH; if(readdir == nil) error(sys->sprint("can't load %s: %r", Readdir->PATH)); - (a, n) := readdir->init("/env", - Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING); + (a, nil) := readdir->init("/env", Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING); for(i := 0; i < len a; i++){ s := a[i].name+"="+env->getenv(a[i].name)+"\n"; b := array of byte s; diff --git a/appl/cmd/gzip.b b/appl/cmd/gzip.b index b87186d0..486e2b2a 100644 --- a/appl/cmd/gzip.b +++ b/appl/cmd/gzip.b @@ -145,7 +145,7 @@ gzip(nil: string, nil: int, bin, bout: ref Iobuf, fin, fout: string): int if (debug) param += "dv"; rq := deflate->start(param); - crc := 0; + for (;;) { pick m := <-rq { Fill => diff --git a/appl/cmd/itest.b b/appl/cmd/itest.b index aa24e4de..d96b0937 100644 --- a/appl/cmd/itest.b +++ b/appl/cmd/itest.b @@ -116,7 +116,7 @@ init(ctxt: ref Draw->Context, args: list of string) else rs = "s"; mreport(0, S_INFO, 2, sys->sprint("Starting tests - %s run%s of %d test%s", reps, rs, len testlist, ts)); run := big 1; - tlist := testlist; + if (recroot != nil) recn := highest(recroot) + 1; while (repcount == 0 || run <= big repcount) { @@ -259,7 +259,7 @@ runtest(t: ref Test) { if (t.failed) return; - path := t.fullspec; + if (cflag != -1) { mreport(0, S_INFO, 7, sys->sprint("Setting cflag to %d", cflag)); set_cflag(cflag); @@ -270,7 +270,7 @@ runtest(t: ref Test) display_file(readme); sync := chan of int; spawn monitor(t, sync); - pid := <-sync; + <-sync; } monitor(t: ref Test, sync: chan of int) @@ -299,7 +299,7 @@ monitor(t: ref Test, sync: chan of int) etime := -1; rsync := chan of int; spawn runit(t.fullspec, t.stdout, t.stderr, t.spec, pa[0], rsync); - rpid := <-rsync; + <-rsync; pa[0] = nil; (nwarns, nerrors, nfatals) := (0, 0, 0); while (1) { diff --git a/appl/cmd/itreplay.b b/appl/cmd/itreplay.b index bba2f591..fb8e9d13 100644 --- a/appl/cmd/itreplay.b +++ b/appl/cmd/itreplay.b @@ -144,7 +144,7 @@ replay_msgs(mfile: string, tspec: string, cflag: int) return; (nwarns, nerrors, nfatals) := (0, 0, 0); stime := 0; - etime := 0; + while ((line := mf.gets('\n')) != nil) { (whens, rest) := str->splitl(line, ":"); when := int whens; diff --git a/appl/cmd/logfile.b b/appl/cmd/logfile.b index 6ec8369e..6a234d23 100644 --- a/appl/cmd/logfile.b +++ b/appl/cmd/logfile.b @@ -87,7 +87,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) for (;;) alt { <-availchan => availcount++; - (off, count, fid, rc) := <-fio.read => + (nil, count, fid, rc) := <-fio.read => r := readers.get(fid); if (rc == nil) { if (r != nil) @@ -112,7 +112,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) r.rq = (count, rc) :: r.rq; } - (off, data, fid, wc) := <-fio.write => + (nil, data, nil, wc) := <-fio.write => if (wc == nil) continue; if ((n := buf.put(data)) < len data) diff --git a/appl/cmd/mdb.b b/appl/cmd/mdb.b index 71938af5..88f2b078 100644 --- a/appl/cmd/mdb.b +++ b/appl/cmd/mdb.b @@ -11,6 +11,16 @@ include "string.m"; include "bufio.m"; bufio: Bufio; Iobuf: import bufio; +include "dis.m"; + dis: Dis; + Inst, Type, Data, Link, Mod: import dis; + XMAGIC: import Dis; + MUSTCOMPILE, DONTCOMPILE: import Dis; + AMP, AFP, AIMM, AXXX, AIND, AMASK: import Dis; + ARM, AXNON, AXIMM, AXINF, AXINM: import Dis; + DEFB, DEFW, DEFS, DEFF, DEFA, DIND, DAPOP, DEFL: import Dis; +disfile: string; +m: ref Mod; Mdb: module { @@ -151,9 +161,29 @@ docmd(s: string) writemem(2, s[2:]); 'W' => writemem(4, s[2:]); + 'i' => + das(); * => dumpmem(s[1:], cmd); } + '$' => + case s[1] { + 'D' => + desc(); + 'h' => + hdr(); + 'l' => + link(); + 'i' => + imports(); + 'd' => + dat(); + 'H' => + handlers(); + 's' => + if(m != nil) + print("%s\n", m.srcpath); + } '=' => dumpmem(s[1:], cmd); * => @@ -294,6 +324,8 @@ init(nil: ref Draw->Context, argv: list of string) sys->fprint(stderr, "mdb: cannot load %s: %r\n", Bufio->PATH); raise "fail:bad module"; } + dis = load Dis Dis->PATH; + dis->init(); if (len argv < 2) usage(); @@ -321,6 +353,7 @@ init(nil: ref Draw->Context, argv: list of string) sys->fprint(stderr, "mdb: cannot open %s: %r\n", fname); raise "fail:cannot open"; } + (m, nil) = dis->loadobj(fname); if(cmd != nil) docmd(cmd); @@ -333,3 +366,172 @@ init(nil: ref Draw->Context, argv: list of string) } } } + +link() +{ + if(m == nil || m.magic == 0) + return; + + for(i := 0; i < m.lsize; i++) { + l := m.links[i]; + print(" link %d,%d, 0x%ux, \"%s\"\n", + l.desc, l.pc, l.sig, l.name); + } +} + +imports() +{ + if(m == nil || m.magic == 0) + return; + + mi := m.imports; + for(i := 0; i < len mi; i++) { + a := mi[i]; + for(j := 0; j < len a; j++) { + ai := a[j]; + print(" import 0x%ux, \"%s\"\n", ai.sig, ai.name); + } + } +} + +handlers() +{ + if(m == nil || m.magic == 0) + return; + + hs := m.handlers; + for(i := 0; i < len hs; i++) { + h := hs[i]; + tt := -1; + for(j := 0; j < len m.types; j++) { + if(h.t == m.types[j]) { + tt = j; + break; + } + } + print(" %d-%d, o=%d, e=%d t=%d\n", h.pc1, h.pc2, h.eoff, h.ne, tt); + et := h.etab; + for(j = 0; j < len et; j++) { + e := et[j]; + if(e.s == nil) + print(" %d *\n", e.pc); + else + print(" %d \"%s\"\n", e.pc, e.s); + } + } +} + +desc() +{ + if(m == nil || m.magic == 0) + return; + + for(i := 0; i < m.tsize; i++) { + h := m.types[i]; + s := sprint(" desc $%d, %d, \"", i, h.size); + for(j := 0; j < h.np; j++) + s += sprint("%.2ux", int h.map[j]); + s += "\"\n"; + print("%s", s); + } +} + +hdr() +{ + if(m == nil || m.magic == 0) + return; + s := sprint("%.8ux Version %d Dis VM\n", m.magic, m.magic - XMAGIC + 1); + s += sprint("%.8ux Runtime flags %s\n", m.rt, rtflag(m.rt)); + s += sprint("%8d bytes per stack extent\n\n", m.ssize); + + + s += sprint("%8d instructions\n", m.isize); + s += sprint("%8d data size\n", m.dsize); + s += sprint("%8d heap type descriptors\n", m.tsize); + s += sprint("%8d link directives\n", m.lsize); + s += sprint("%8d entry pc\n", m.entry); + s += sprint("%8d entry type descriptor\n\n", m.entryt); + + if(m.sign == nil) + s += "Module is Insecure\n"; + print("%s", s); +} + +rtflag(flag: int): string +{ + if(flag == 0) + return ""; + + s := "["; + + if(flag & MUSTCOMPILE) + s += "MustCompile"; + if(flag & DONTCOMPILE) { + if(flag & MUSTCOMPILE) + s += "|"; + s += "DontCompile"; + } + s[len s] = ']'; + + return s; +} + +das() +{ + if(m == nil || m.magic == 0) + return; + + for(i := dot; count-- > 0 && i < m.isize; i++) { + if(i % 10 == 0) + print("#%d\n", i); + print("\t%s\n", dis->inst2s(m.inst[i])); + } +} + +dat() +{ + if(m == nil || m.magic == 0) + return; + print(" var @mp, %d\n", m.types[0].size); + + s := ""; + for(d := m.data; d != nil; d = tl d) { + pick dat := hd d { + Bytes => + s = sprint("\tbyte @mp+%d", dat.off); + for(n := 0; n < dat.n; n++) + s += sprint(",%d", int dat.bytes[n]); + Words => + s = sprint("\tword @mp+%d", dat.off); + for(n := 0; n < dat.n; n++) + s += sprint(",%d", dat.words[n]); + String => + s = sprint("\tstring @mp+%d, \"%s\"", dat.off, mapstr(dat.str)); + Reals => + s = sprint("\treal @mp+%d", dat.off); + for(n := 0; n < dat.n; n++) + s += sprint(", %g", dat.reals[n]); + break; + Array => + s = sprint("\tarray @mp+%d,$%d,%d", dat.off, dat.typex, dat.length); + Aindex => + s = sprint("\tindir @mp+%d,%d", dat.off, dat.index); + Arestore => + s = "\tapop"; + break; + Bigs => + s = sprint("\tlong @mp+%d", dat.off); + for(n := 0; n < dat.n; n++) + s += sprint(", %bd", dat.bigs[n]); + } + print("%s\n", s); + } +} + +mapstr(s: string): string +{ + for(i := 0; i < len s; i++) + if(s[i] == '\n') + s = s[0:i] + "\\n" + s[i+1:]; + return s; +} diff --git a/appl/cmd/memfs.b b/appl/cmd/memfs.b index e18388c5..20ccdc64 100644 --- a/appl/cmd/memfs.b +++ b/appl/cmd/memfs.b @@ -217,7 +217,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in c.mode = tm.mode; c.qid.vers = mf.qid.vers; mf.nopen++; - if (tm.mode & OTRUNC) { + if ((tm.mode & OTRUNC) && !(mf.perm & Sys->DMAPPEND)) { # OTRUNC cannot be set for a directory # always at least one blk so don't need to check fs limit freeblks += (len mf.data); @@ -321,7 +321,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in } srv.reply(ref Rmsg.Clunk(tm.tag)); Stat => - (err, c, mf) := fidtomf(srv, qhash, tm.fid); + (err, nil, mf) := fidtomf(srv, qhash, tm.fid); if (err != nil) { srv.reply(ref Rmsg.Error(tm.tag, err)); continue; @@ -354,7 +354,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in Wstat => (err, c, mf) := fidtomf(srv, qhash, tm.fid); stat := tm.stat; - perm := mf.perm & ~Sys->DMDIR; + if (err == nil && stat.name != mf.name) { parent := mf.parent; if (!modeok(OWRITE, parent.perm, c.uname, parent.owner)) diff --git a/appl/cmd/mkdir.b b/appl/cmd/mkdir.b index 21e03ee7..55a4d564 100644 --- a/appl/cmd/mkdir.b +++ b/appl/cmd/mkdir.b @@ -29,7 +29,7 @@ init(nil: ref Draw->Context, argv: list of string) for(; argv != nil; argv = tl argv){ dir := hd argv; if(!pflag){ - (ok, d) := sys->stat(dir); + (ok, nil) := sys->stat(dir); if(ok < 0){ if(mkdir(dir) < 0) e = "error"; diff --git a/appl/cmd/mntgen.b b/appl/cmd/mntgen.b index 3f066425..a83e2905 100644 --- a/appl/cmd/mntgen.b +++ b/appl/cmd/mntgen.b @@ -79,7 +79,7 @@ walk1(c: ref Fid, name: string): string decref(c.path); c.walk(Sys->Qid(Qroot, 0, Sys->QTDIR)); } else if (c.path == Qroot) { - (d, err) := nav.walk(c.path, name); + (d, nil) := nav.walk(c.path, name); if (d == nil) d = addentry(name); else diff --git a/appl/cmd/mouse.b b/appl/cmd/mouse.b index 9e21d61a..82a28d5c 100644 --- a/appl/cmd/mouse.b +++ b/appl/cmd/mouse.b @@ -49,8 +49,8 @@ init(nil: ref Draw->Context, argv: list of string) usage(); argv = tl argv; - def := 0; - baud := 0; + + while (argv != nil && len (arg := hd argv) > 1 && arg[0] == '-') { case arg[1] { 'D' => diff --git a/appl/cmd/mv.b b/appl/cmd/mv.b index 2ca8e671..a6d3f43c 100644 --- a/appl/cmd/mv.b +++ b/appl/cmd/mv.b @@ -113,7 +113,6 @@ mv(from,todir,toelem : string): int sys->fprint(stderr, "mv: can't open %s: %r\n", fromname); return -1; } - (j,dirt):=sys->stat(toname); fdt := sys->create(toname, Sys->OWRITE, dirb.mode); if(fdt == nil){ sys->fprint(stderr, "mv: can't create %s: %r\n", toname); diff --git a/appl/cmd/ramfile.b b/appl/cmd/ramfile.b index 677bf18b..3451d7df 100644 --- a/appl/cmd/ramfile.b +++ b/appl/cmd/ramfile.b @@ -52,7 +52,7 @@ init(nil: ref Draw->Context, argv: list of string) server(fio: ref Sys->FileIO, data: array of byte) { for (;;) alt { - (offset, count, fid, rc) := <-fio.read => + (offset, count, nil, rc) := <-fio.read => if (rc != nil) { if (offset > len data) rc <-= (nil, nil); @@ -63,7 +63,7 @@ server(fio: ref Sys->FileIO, data: array of byte) rc <-= (data[offset:end], nil); } } - (offset, d, fid, wc) := <-fio.write => + (offset, d, nil, wc) := <-fio.write => if (wc != nil) { if (offset == 0) data = array[0] of byte; diff --git a/appl/cmd/rcmd.b b/appl/cmd/rcmd.b index 43fe9078..69061a73 100644 --- a/appl/cmd/rcmd.b +++ b/appl/cmd/rcmd.b @@ -141,7 +141,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/stack.b b/appl/cmd/stack.b index 7b90a0b5..189870d3 100644 --- a/appl/cmd/stack.b +++ b/appl/cmd/stack.b @@ -155,7 +155,7 @@ stdsym(m: ref Module) } if(dism != nil && (sp := dism->src(dis)) != nil){ sp = sp[0: len sp - 1] + "sbl"; - (sym, err) := debug->sym(sp); + (sym, nil) := debug->sym(sp); if (sym != nil) { m.addsym(sym); return; @@ -167,7 +167,7 @@ stdsym(m: ref Module) sblpath = sblpath + dis[len dispath:]; if (len sblpath > 4 && sblpath[len sblpath - 4:] == ".dis") sblpath = sblpath[0:len sblpath - 4] + ".sbl"; - (sym, err) := debug->sym(sblpath); + (sym, nil) := debug->sym(sblpath); if (sym != nil) { m.addsym(sym); return; diff --git a/appl/cmd/stackv.b b/appl/cmd/stackv.b index 173f8b30..4688f804 100644 --- a/appl/cmd/stackv.b +++ b/appl/cmd/stackv.b @@ -360,6 +360,8 @@ plist(exp: ref Exp, v: string, w: int, depth: int) while(w && v != "nil"){ exps := exp.expand(); h := getname(exps, "hd"); + if(h == nil) + break; (hv, vw) := h.val(); if(pref(v) == 0) return; diff --git a/appl/cmd/styxchat.b b/appl/cmd/styxchat.b index f0b1f2c5..f66b49fe 100644 --- a/appl/cmd/styxchat.b +++ b/appl/cmd/styxchat.b @@ -111,7 +111,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/styxlisten.b b/appl/cmd/styxlisten.b index 2147e619..df136e47 100644 --- a/appl/cmd/styxlisten.b +++ b/appl/cmd/styxlisten.b @@ -250,7 +250,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/tail.b b/appl/cmd/tail.b index 07d900d1..af438296 100644 --- a/appl/cmd/tail.b +++ b/appl/cmd/tail.b @@ -57,7 +57,7 @@ init(nil: ref Draw->Context, argv: list of string) else { if((file=sys->open(hd argv,sys->OREAD)) == nil ) fatal(hd argv); - (ok, stat) := sys->fstat(file); + (nil, stat) := sys->fstat(file); seekable = sys->seek(file,big 0,sys->SEEKSTART) == big 0 && stat.length > big 0; } @@ -99,7 +99,7 @@ init(nil: ref Draw->Context, argv: list of string) trunc(length : big) : sys->Dir { - (i,d):=sys->fstat(file); + (nil,d):=sys->fstat(file); if(d.length < length) d.length = tseek(big 0, sys->SEEKSTART); return d; diff --git a/appl/cmd/telnet.b b/appl/cmd/telnet.b index 0a30f3f9..ff5a59e0 100644 --- a/appl/cmd/telnet.b +++ b/appl/cmd/telnet.b @@ -470,7 +470,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/tsort.b b/appl/cmd/tsort.b index 5993fa31..4be473dd 100644 --- a/appl/cmd/tsort.b +++ b/appl/cmd/tsort.b @@ -60,7 +60,7 @@ input() { b := bufio->fopen(sys->fildes(0), Sys->OREAD); while((line := b.gets('\n')) != nil){ - (nf, fld) := sys->tokenize(line, " \t\n"); + (nil, fld) := sys->tokenize(line, " \t\n"); if(fld != nil){ a := finditem(hd fld); while((fld = tl fld) != nil) diff --git a/appl/cmd/xmount.b b/appl/cmd/xmount.b index 6d86c939..484c23f6 100644 --- a/appl/cmd/xmount.b +++ b/appl/cmd/xmount.b @@ -219,7 +219,7 @@ netmkaddr(addr, net, svc: string): string { if(net == nil) net = "net"; - (n, l) := sys->tokenize(addr, "!"); + (n, nil) := sys->tokenize(addr, "!"); if(n <= 1){ if(svc== nil) return sys->sprint("%s!%s", net, addr); diff --git a/appl/cmd/yacc.b b/appl/cmd/yacc.b index 97ef87cf..897d2c69 100644 --- a/appl/cmd/yacc.b +++ b/appl/cmd/yacc.b @@ -781,7 +781,6 @@ gettok(): int tokname = ""; for(;;){ - reserve := 0; lineno += peekline; peekline = 0; c = finput.getc(); |
