aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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] = '/';