diff options
author | Russ Cox <rsc@swtch.com> | 2014-04-18 14:03:46 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2014-04-18 14:03:46 -0400 |
commit | d213189122bb3cd509cfe706240ffea528fee5f2 (patch) | |
tree | bafc860a1210ce6d16157e52368fe88436ee9e7d | |
parent | 2f902c413872154d4f8ff996b837fe7e8bfd111c (diff) | |
download | plan9port-d213189122bb3cd509cfe706240ffea528fee5f2.tar.gz plan9port-d213189122bb3cd509cfe706240ffea528fee5f2.tar.bz2 plan9port-d213189122bb3cd509cfe706240ffea528fee5f2.zip |
acme: fix Get of dir in nameless window (thanks Colton Lewis)
TBR=r
https://codereview.appspot.com/89390043
-rw-r--r-- | src/cmd/acme/text.c | 2 |
1 files changed, 1 insertions, 1 deletions
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] = '/'; |