commit d213189122bb3cd509cfe706240ffea528fee5f2
parent 2f902c413872154d4f8ff996b837fe7e8bfd111c
Author: Russ Cox <rsc@swtch.com>
Date: Fri, 18 Apr 2014 14:03:46 -0400
acme: fix Get of dir in nameless window (thanks Colton Lewis)
TBR=r
https://codereview.appspot.com/89390043
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
@@ -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] = '/';