# HG changeset patch # User asl # Date 1078819860 0 # Node ID d1185a575d2f11af3db669ef5480ed68f4a06d24 # Parent cbea1375c6dadc8be3fc2006ae3479f4dbd83b5b * src/ramfs.c : (ramfs_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/ram/current/ChangeLog b/packages/fs/ram/current/ChangeLog --- a/packages/fs/ram/current/ChangeLog +++ b/packages/fs/ram/current/ChangeLog @@ -1,3 +1,15 @@ +2004-02-20 Vincent Catros + + * src/ramfs.c : + (ramfs_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-25 Jonathan Larmour * src/ramfs.c (findbuffer_node): If pos larger than even INDIRECT2_MAX diff --git a/packages/fs/ram/current/src/ramfs.c b/packages/fs/ram/current/src/ramfs.c --- a/packages/fs/ram/current/src/ramfs.c +++ b/packages/fs/ram/current/src/ramfs.c @@ -1347,7 +1347,8 @@ static int find_entry( ramfs_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; @@ -1398,7 +1399,7 @@ static int ramfs_find( ramfs_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 } }