upas/fs: fix walk
This commit is contained in:
parent
70f700699a
commit
5d2bffc26f
1 changed files with 7 additions and 10 deletions
|
@ -791,8 +791,8 @@ char*
|
||||||
dowalk(Fid *f, char *name)
|
dowalk(Fid *f, char *name)
|
||||||
{
|
{
|
||||||
char *rv, *p;
|
char *rv, *p;
|
||||||
int t, t1;
|
|
||||||
Hash *h;
|
Hash *h;
|
||||||
|
int t;
|
||||||
|
|
||||||
if(f->qid.type != QTDIR)
|
if(f->qid.type != QTDIR)
|
||||||
return Enotdir;
|
return Enotdir;
|
||||||
|
@ -801,13 +801,12 @@ dowalk(Fid *f, char *name)
|
||||||
|
|
||||||
/* this must catch everything except . and .. */
|
/* this must catch everything except . and .. */
|
||||||
retry:
|
retry:
|
||||||
t1 = FILE(f->qid.path);
|
if(t == Qdir && *name >= 'a' && *name <= 'z'){
|
||||||
if((t1 == Qmbox || t1 == Qdir) && *name >= 'a' && *name <= 'z'){
|
|
||||||
h = hlook(f->qid.path, "xxx"); /* sleezy speedup */
|
h = hlook(f->qid.path, "xxx"); /* sleezy speedup */
|
||||||
t1 = dindex(name);
|
t = dindex(name);
|
||||||
if(t1 == -1)
|
if(t == -1)
|
||||||
h = nil;
|
h = nil;
|
||||||
}else
|
} else
|
||||||
h = hlook(f->qid.path, name);
|
h = hlook(f->qid.path, name);
|
||||||
if(h != nil){
|
if(h != nil){
|
||||||
if(h->mb)
|
if(h->mb)
|
||||||
|
@ -821,8 +820,8 @@ retry:
|
||||||
f->m = h->m;
|
f->m = h->m;
|
||||||
f->mb = h->mb;
|
f->mb = h->mb;
|
||||||
f->qid = h->qid;
|
f->qid = h->qid;
|
||||||
if(t1 < Qmax)
|
if(t < Qmax)
|
||||||
f->qid.path = PATH(f->m->id, t1); /* sleezy speedup */
|
f->qid.path = PATH(f->m->id, t); /* sleezy speedup */
|
||||||
rv = nil;
|
rv = nil;
|
||||||
}else if((p = strchr(name, '.')) != nil && *name != '.'){
|
}else if((p = strchr(name, '.')) != nil && *name != '.'){
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
@ -1101,8 +1100,6 @@ rread(Fid *f)
|
||||||
n = readtopdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
n = readtopdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
||||||
else if(t == Qmbox)
|
else if(t == Qmbox)
|
||||||
n = readmboxdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
n = readmboxdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
||||||
else if(t == Qmboxctl)
|
|
||||||
n = 0;
|
|
||||||
else
|
else
|
||||||
n = readmsgdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
n = readmsgdir(f, mbuf, off, cnt, messagesize - IOHDRSZ);
|
||||||
rhdr.count = n;
|
rhdr.count = n;
|
||||||
|
|
Loading…
Reference in a new issue