shithub: riscv

Download patch

ref: 5d2bffc26f8227530597aa3e9160f516ffe181cf
parent: 70f700699ac06fb33267395c60f62b4fae3f4f15
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Nov 21 12:32:36 EST 2018

upas/fs: fix walk

--- a/sys/src/cmd/upas/fs/fs.c
+++ b/sys/src/cmd/upas/fs/fs.c
@@ -791,8 +791,8 @@
 dowalk(Fid *f, char *name)
 {
 	char *rv, *p;
-	int t, t1;
 	Hash *h;
+	int t;
 
 	if(f->qid.type != QTDIR)
 		return Enotdir;
@@ -801,13 +801,12 @@
 
 	/* this must catch everything except . and .. */
 retry:
-	t1 = FILE(f->qid.path);
-	if((t1 == Qmbox || t1 == Qdir) && *name >= 'a' && *name <= 'z'){
+	if(t == Qdir && *name >= 'a' && *name <= 'z'){
 		h = hlook(f->qid.path, "xxx");		/* sleezy speedup */
-		t1 = dindex(name);
-		if(t1 == -1)
+		t = dindex(name);
+		if(t == -1)
 			h = nil;
-	}else
+	} else
 		h = hlook(f->qid.path, name);
 	if(h != nil){
 		if(h->mb)
@@ -821,8 +820,8 @@
 		f->m = h->m;
 		f->mb = h->mb;
 		f->qid = h->qid;
-		if(t1 < Qmax)
-			f->qid.path = PATH(f->m->id, t1);	/* sleezy speedup */
+		if(t < Qmax)
+			f->qid.path = PATH(f->m->id, t);	/* sleezy speedup */
 		rv = nil;
 	}else if((p = strchr(name, '.')) != nil && *name != '.'){
 		*p = 0;
@@ -1101,8 +1100,6 @@
 			n = readtopdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
 		else if(t == Qmbox)
 			n = readmboxdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
-		else if(t == Qmboxctl)
-			n = 0;
 		else
 			n = readmsgdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
 		rhdr.count = n;