summaryrefslogtreecommitdiff
path: root/sys/src/cmd/acme
diff options
context:
space:
mode:
authoriru <devnull@localhost>2014-08-16 18:50:42 -0300
committeriru <devnull@localhost>2014-08-16 18:50:42 -0300
commit0bc51a90b0e9903ede7edb4750c415e9d6f422c7 (patch)
treee9289cb6bfe9b2bef3906d3b65db0cfbdd9a52e9 /sys/src/cmd/acme
parent773b57b676526975059e5ba3858cfde6d8b50ceb (diff)
Fix acme crash: Get D in a new window with D being an existing directory
Diffstat (limited to 'sys/src/cmd/acme')
-rw-r--r--sys/src/cmd/acme/text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/acme/text.c b/sys/src/cmd/acme/text.c
index eda8f10de..957bca37d 100644
--- a/sys/src/cmd/acme/text.c
+++ b/sys/src/cmd/acme/text.c
@@ -213,7 +213,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] = '/';