changeset 1532:d1185a575d2f

* 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///)).
author asl
date Tue, 09 Mar 2004 08:11:00 +0000
parents cbea1375c6da
children 89eafd905d8d
files packages/fs/ram/current/ChangeLog packages/fs/ram/current/src/ramfs.c
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/ram/current/ChangeLog
+++ b/packages/fs/ram/current/ChangeLog
@@ -1,3 +1,15 @@
+2004-02-20  Vincent Catros  <Vincent.Catros@elios-informatique.fr>
+
+	* 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  <jifl@eCosCentric.com>
 
 	* src/ramfs.c (findbuffer_node): If pos larger than even INDIRECT2_MAX
--- 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
     }
 }