aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/text.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2014-04-18 14:03:46 -0400
committerRuss Cox <rsc@swtch.com>2014-04-18 14:03:46 -0400
commitd213189122bb3cd509cfe706240ffea528fee5f2 (patch)
treebafc860a1210ce6d16157e52368fe88436ee9e7d /src/cmd/acme/text.c
parent2f902c413872154d4f8ff996b837fe7e8bfd111c (diff)
downloadplan9port-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
Diffstat (limited to 'src/cmd/acme/text.c')
-rw-r--r--src/cmd/acme/text.c2
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] = '/';