shithub: riscv

Download patch

ref: 0bc51a90b0e9903ede7edb4750c415e9d6f422c7
parent: 773b57b676526975059e5ba3858cfde6d8b50ceb
author: iru <devnull@localhost>
date: Sat Aug 16 14:50:42 EDT 2014

Fix acme crash: Get D in a new window with D being an existing directory

--- a/sys/src/cmd/acme/text.c
+++ b/sys/src/cmd/acme/text.c
@@ -213,7 +213,7 @@
 		}
 		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] = '/';