From d213189122bb3cd509cfe706240ffea528fee5f2 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 18 Apr 2014 14:03:46 -0400 Subject: acme: fix Get of dir in nameless window (thanks Colton Lewis) TBR=r https://codereview.appspot.com/89390043 --- src/cmd/acme/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd') diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c index c055c5e3..7ea6de93 100644 --- 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] = '/'; -- cgit v1.2.3