Subversion Repositories HelenOS

Rev

Rev 2770 | Rev 2792 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2770 Rev 2791
Line 146... Line 146...
146
    if (last < next)
146
    if (last < next)
147
        last += PLB_SIZE;
147
        last += PLB_SIZE;
148
 
148
 
149
    void *par = NULL;
149
    void *par = NULL;
150
    void *cur = ops->root_get();
150
    void *cur = ops->root_get();
151
    void *tmp = ops->child_get(cur);
151
    void *tmp;
152
 
152
 
153
    if (ops->plb_get_char(next) == '/')
153
    if (ops->plb_get_char(next) == '/')
154
        next++;     /* eat slash */
154
        next++;     /* eat slash */
155
   
155
   
156
    char component[NAME_MAX + 1];
156
    char component[NAME_MAX + 1];
157
    int len = 0;
157
    int len = 0;
158
    while (tmp && next <= last) {
158
    while (ops->has_children(cur) && next <= last) {
159
 
159
 
160
        /* collect the component */
160
        /* collect the component */
161
        if (ops->plb_get_char(next) != '/') {
161
        if (ops->plb_get_char(next) != '/') {
162
            if (len + 1 == NAME_MAX) {
162
            if (len + 1 == NAME_MAX) {
163
                /* comopnent length overflow */
163
                /* comopnent length overflow */
Line 174... Line 174...
174
        component[len] = '\0';
174
        component[len] = '\0';
175
        next++;     /* eat slash */
175
        next++;     /* eat slash */
176
        len = 0;
176
        len = 0;
177
 
177
 
178
        /* match the component */
178
        /* match the component */
179
        while (tmp && !ops->match(cur, tmp, component))
179
        tmp = ops->match(cur, component);
180
            tmp = ops->sibling_get(tmp);
-
 
181
 
180
 
182
        /* handle miss: match amongst siblings */
181
        /* handle miss: match amongst siblings */
183
        if (!tmp) {
182
        if (!tmp) {
184
            if (next <= last) {
183
            if (next <= last) {
185
                /* there are unprocessed components */
184
                /* there are unprocessed components */
Line 226... Line 225...
226
        }
225
        }
227
 
226
 
228
        /* descend one level */
227
        /* descend one level */
229
        par = cur;
228
        par = cur;
230
        cur = tmp;
229
        cur = tmp;
231
        tmp = ops->child_get(tmp);
-
 
232
    }
230
    }
233
 
231
 
234
    /* handle miss: excessive components */
232
    /* handle miss: excessive components */
235
    if (!tmp && next <= last) {
233
    if (!ops->has_children(cur) && next <= last) {
236
        if (lflag & (L_CREATE | L_LINK)) {
234
        if (lflag & (L_CREATE | L_LINK)) {
237
            if (!ops->is_directory(cur)) {
235
            if (!ops->is_directory(cur)) {
238
                ipc_answer_0(rid, ENOTDIR);
236
                ipc_answer_0(rid, ENOTDIR);
239
                return;
237
                return;
240
            }
238
            }