tacme: fix Get of dir in nameless window (thanks Colton Lewis) - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit d213189122bb3cd509cfe706240ffea528fee5f2
(DIR) parent 2f902c413872154d4f8ff996b837fe7e8bfd111c
(HTM) Author: Russ Cox <rsc@swtch.com>
Date: Fri, 18 Apr 2014 14:03:46 -0400
acme: fix Get of dir in nameless window (thanks Colton Lewis)
TBR=r
https://codereview.appspot.com/89390043
Diffstat:
M src/cmd/acme/text.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/src/cmd/acme/text.c b/src/cmd/acme/text.c
t@@ -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] = '/';