mirror of
https://github.com/0intro/wmii
synced 2025-01-31 06:17:06 +03:00
fixed fs access issues on mkqid for /new namespace
This commit is contained in:
parent
510535e7bb
commit
9f232d69b5
@ -264,13 +264,15 @@ mkqid(Qid *dir, char *wname, Qid *new)
|
||||
break;
|
||||
case Darea:
|
||||
fprintf(stderr, "mkqid(): %s\n", "Darea");
|
||||
if(!npage)
|
||||
if(!npage || dpg >= npage)
|
||||
return -1;
|
||||
new->type = IXP_QTDIR;
|
||||
if(!strncmp(wname, "new", 4))
|
||||
new->path = mkqpath(Darea, dpgid, NEW_OBJ, 0);
|
||||
else if(!strncmp(wname, "sel", 4)) {
|
||||
Page *p = page[dpg];
|
||||
if(!p->narea)
|
||||
return -1;
|
||||
new->path = mkqpath(Darea, dpgid, p->area[p->sel]->id, 0);
|
||||
}
|
||||
else {
|
||||
@ -286,6 +288,8 @@ mkqid(Qid *dir, char *wname, Qid *new)
|
||||
new->type = IXP_QTDIR;
|
||||
if(!strncmp(wname, "sel", 4)) {
|
||||
Area *a = page[dpg]->area[darea];
|
||||
if(!a->nclient)
|
||||
return -1;
|
||||
new->path = mkqpath(Dclient, dpgid, daid, a->client[a->sel]->id);
|
||||
}
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user