acme: fix Get of dir in nameless window (thanks Colton Lewis)

TBR=r
https://codereview.appspot.com/89390043
This commit is contained in:
Russ Cox 2014-04-18 14:03:46 -04:00
parent 2f902c4138
commit d213189122

View file

@ -228,7 +228,7 @@ textload(Text *t, uint q0, char *file, int setqid)
}
t->w->isdir = TRUE;
t->w->filemenu = FALSE;
if(t->file->name[t->file->nname-1] != '/'){
if(t->file->nname > 0 && t->file->name[t->file->nname-1] != '/'){
rp = runemalloc(t->file->nname+1);
runemove(rp, t->file->name, t->file->nname);
rp[t->file->nname] = '/';