diff options
author | rsc <devnull@localhost> | 2005-01-04 21:39:23 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-04 21:39:23 +0000 |
commit | 627bae9c76134c3db23162ce718b0c2725d26441 (patch) | |
tree | 7dd1bc33c2c17d9457addd968ce2e268908657a6 | |
parent | f755d504015485c32e893b474ca42493a9f3dd67 (diff) | |
download | plan9port-627bae9c76134c3db23162ce718b0c2725d26441.tar.gz plan9port-627bae9c76134c3db23162ce718b0c2725d26441.tar.bz2 plan9port-627bae9c76134c3db23162ce718b0c2725d26441.zip |
clean up mkfile; fix winctlprint bug reported by peter canning
-rw-r--r-- | src/cmd/acme/dat.h | 2 | ||||
-rw-r--r-- | src/cmd/acme/mkfile | 10 | ||||
-rw-r--r-- | src/cmd/acme/wind.c | 10 | ||||
-rw-r--r-- | src/cmd/acme/xfid.c | 14 |
4 files changed, 15 insertions, 21 deletions
diff --git a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h index 476bbfd1..9db71286 100644 --- a/src/cmd/acme/dat.h +++ b/src/cmd/acme/dat.h @@ -285,7 +285,7 @@ void winevent(Window*, char*, ...); void winmousebut(Window*); void winaddincl(Window*, Rune*, int); void wincleartag(Window*); -void winctlprint(Window*, char*, int); +char *winctlprint(Window*, char*, int); struct Column { diff --git a/src/cmd/acme/mkfile b/src/cmd/acme/mkfile index fbb34d1a..0b7a1827 100644 --- a/src/cmd/acme/mkfile +++ b/src/cmd/acme/mkfile @@ -1,5 +1,3 @@ -# Acme is up-to-date w.r.t. sources as of 29 February 2004 - <$PLAN9/src/mkhdr TARG=acme @@ -30,14 +28,6 @@ HFILES=dat.h\ edit.h\ fns.h\ -UPDATE=\ - mkfile\ - $HFILES\ - ${OFILES:%.$O=%.c}\ - -SHORTLIB=complete plumb fs mux thread frame draw bio 9 <$PLAN9/src/mkone -LDFLAGS=$LDFLAGS -L$X11/lib -lX11 - edit.$O ecmd.$O elog.$O: edit.h diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c index edb5d68e..5b6171d7 100644 --- a/src/cmd/acme/wind.c +++ b/src/cmd/acme/wind.c @@ -543,15 +543,15 @@ winclean(Window *w, int conservative) /* as it stands, conservative is always TR return TRUE; } -void +char* winctlprint(Window *w, char *buf, int fonts) { - int n; - - n = sprint(buf, "%11d %11d %11d %11d %11d ", w->id, w->tag.file->b.nc, + sprint(buf, "%11d %11d %11d %11d %11d ", w->id, w->tag.file->b.nc, w->body.file->b.nc, w->isdir, w->dirty); if(fonts) - sprint(buf+n, "%11d %q %11d" , Dx(w->body.fr.r), w->body.reffont->f->name, w->body.fr.maxtab); + return smprint("%s%11d %q %11d ", buf, Dx(w->body.fr.r), + w->body.reffont->f->name, w->body.fr.maxtab); + return buf; } void diff --git a/src/cmd/acme/xfid.c b/src/cmd/acme/xfid.c index 5a2723a4..13d72957 100644 --- a/src/cmd/acme/xfid.c +++ b/src/cmd/acme/xfid.c @@ -255,7 +255,7 @@ xfidread(Xfid *x) int n, q; uint off; char *b; - char buf[128]; + char buf[256]; Window *w; q = FILE(x->f->qid); @@ -295,18 +295,22 @@ xfidread(Xfid *x) break; case QWctl: - winctlprint(w, buf, 1); - goto Readbuf; + b = winctlprint(w, buf, 1); + goto Readb; Readbuf: - n = strlen(buf); + b = buf; + Readb: + n = strlen(b); if(off > n) off = n; if(off+x->fcall.count > n) x->fcall.count = n-off; fc.count = x->fcall.count; - fc.data = buf+off; + fc.data = b+off; respond(x, &fc, nil); + if(b != buf) + free(b); break; case QWevent: |