diff options
author | rsc <devnull@localhost> | 2004-05-14 15:14:21 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-05-14 15:14:21 +0000 |
commit | 1a8f27c35024af7b4ed857a388d20f0a4a560db0 (patch) | |
tree | b70f33150772d665fd2c254655b2782289b0c9da /src/cmd/acme | |
parent | a796abef1632f379ced703b1b2e691d8f63436e2 (diff) | |
download | plan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.tar.gz plan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.tar.bz2 plan9port-1a8f27c35024af7b4ed857a388d20f0a4a560db0.zip |
various bug fixes
Diffstat (limited to 'src/cmd/acme')
-rw-r--r-- | src/cmd/acme/exec.c | 2 | ||||
-rw-r--r-- | src/cmd/acme/rows.c | 4 | ||||
-rw-r--r-- | src/cmd/acme/text.c | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index 7dc1e88b..3bc10371 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -1308,7 +1308,7 @@ runproc(void *argvp) name[e-t] = 0; e = utfrrune(name, '/'); if(e) - strcpy(name, e+1); + memmove(name, e+1, strlen(e+1)+1); /* strcpy but overlaps */ strcat(name, " "); /* add blank here for ease in waittask */ c->name = bytetorune(name, &c->nname); free(name); diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c index 11014c2c..9fa54248 100644 --- a/src/cmd/acme/rows.c +++ b/src/cmd/acme/rows.c @@ -663,12 +663,12 @@ rowload(Row *row, char *file, int initing) break; wincleartag(w); textinsert(&w->tag, w->tag.file->b.nc, r+n+1, nr-(n+1), TRUE); - free(r); if(ndumped >= 0){ /* simplest thing is to put it in a file and load that */ sprint(buf, "/tmp/d%d.%.4sacme", getpid(), getuser()); fd = create(buf, OWRITE|ORCLOSE, 0600); if(fd < 0){ + free(r); warning(nil, "can't create temp file: %r\n"); goto Rescue2; } @@ -679,6 +679,7 @@ rowload(Row *row, char *file, int initing) if(rune == '\n') line++; if(rune == (Rune)Beof){ + free(r); Bterm(bout); free(bout); close(fd); @@ -696,6 +697,7 @@ rowload(Row *row, char *file, int initing) winsettag(w); }else if(dumpid==0 && r[ns+1]!='+' && r[ns+1]!='-') get(&w->body, nil, nil, FALSE, XXX, nil, 0); + free(r); if(fontr){ fontx(&w->body, nil, nil, 0, 0, fontr, nfontr); free(fontr); diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c index aa58be1a..37613d80 100644 --- a/src/cmd/acme/text.c +++ b/src/cmd/acme/text.c @@ -963,8 +963,11 @@ textshow(Text *t, uint q0, uint q1, int doselect) int nl; uint q; - if(t->what != Body) + if(t->what != Body){ + if(doselect) + textsetselect(t, q0, q1); return; + } if(t->w!=nil && t->fr.maxlines==0) colgrow(t->col, t->w, 1); if(doselect) |