Mercurial > ecos
diff packages/fs/rom/current/src/romfs.c @ 1533:89eafd905d8d
* src/fs-ecos.c :
(jffs2_find) Policy to skip path separator is no longer
"if '/' then skip" but "while '/' then skip" allowing
multi '/' separators (i.e : /tmp////foo).
(find_entry) Policy to detect end of path is no longer
"if '\0' then end_of_path"
but "while '/' skip it and then if '\0' then end_of_path"
allowing path terminated with any number of '/'
(i.e : chdir(/tmp///)).
| author | asl |
|---|---|
| date | Tue, 09 Mar 2004 08:11:27 +0000 |
| parents | 4367d4c65982 |
| children | fb1561fe12e7 |
line wrap: on
line diff
--- a/packages/fs/rom/current/src/romfs.c +++ b/packages/fs/rom/current/src/romfs.c @@ -450,7 +450,8 @@ static int find_entry( romfs_dirsearch * while( *n != '\0' && *n != '/' ) n++, namelen++; - // If we terminated on a NUL, set last flag. + // Check if this is the last path element. + while( *n == '/') n++; if( *n == '\0' ) ds->last = true; @@ -501,7 +502,7 @@ static int romfs_find( romfs_dirsearch * // Update dirsearch object to search next directory. d->dir = d->node; d->path += d->namelen; - if( *(d->path) == '/' ) d->path++; // skip dirname separators + while( *(d->path) == '/' ) d->path++; // skip dirname separators } }
