various bug fixes

This commit is contained in:
rsc 2004-05-14 15:14:21 +00:00
parent a796abef16
commit 1a8f27c350
14 changed files with 1236 additions and 9 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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)