# HG changeset patch # User asl # Date 1078819887 0 # Node ID 89eafd905d8d059a892870d6986c342e2ab5c851 # Parent d1185a575d2f11af3db669ef5480ed68f4a06d24 * 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///)). diff --git a/packages/fs/jffs2/current/ChangeLog b/packages/fs/jffs2/current/ChangeLog --- a/packages/fs/jffs2/current/ChangeLog +++ b/packages/fs/jffs2/current/ChangeLog @@ -1,3 +1,15 @@ +2004-02-20 Vincent Catros + + * 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///)). + 2004-02-17 David Woodhouse * src/fs-ecos.c: diff --git a/packages/fs/jffs2/current/src/fs-ecos.c b/packages/fs/jffs2/current/src/fs-ecos.c --- a/packages/fs/jffs2/current/src/fs-ecos.c +++ b/packages/fs/jffs2/current/src/fs-ecos.c @@ -263,7 +263,8 @@ static int find_entry(jffs2_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; @@ -353,7 +354,7 @@ static int jffs2_find(jffs2_dirsearch * // Update dirsearch object to search next directory. d->dir = d->node; d->path += d->namelen; - if (*(d->path) == '/') + while (*(d->path) == '/') d->path++; // skip dirname separators } } diff --git a/packages/fs/rom/current/ChangeLog b/packages/fs/rom/current/ChangeLog --- a/packages/fs/rom/current/ChangeLog +++ b/packages/fs/rom/current/ChangeLog @@ -1,3 +1,15 @@ +2004-02-20 Vincent Catros + + * 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///)). + 2003-12-11 Sandeep Kumar * src/romfs.c (romfs_mount) : function wrongly returns ENOENT even diff --git a/packages/fs/rom/current/src/romfs.c b/packages/fs/rom/current/src/romfs.c --- 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 } }