changeset 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 d1185a575d2f
children 606f06850b83
files packages/fs/jffs2/current/ChangeLog packages/fs/jffs2/current/src/fs-ecos.c packages/fs/rom/current/ChangeLog packages/fs/rom/current/src/romfs.c
diffstat 4 files changed, 30 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/fs/jffs2/current/ChangeLog
+++ b/packages/fs/jffs2/current/ChangeLog
@@ -1,3 +1,15 @@
+2004-02-20  Vincent Catros  <Vincent.Catros@elios-informatique.fr>
+
+	* 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  <dwmw2@redhat.com>
 
 	* 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
 	}
 }
--- a/packages/fs/rom/current/ChangeLog
+++ b/packages/fs/rom/current/ChangeLog
@@ -1,3 +1,15 @@
+2004-02-20  Vincent Catros  <Vincent.Catros@elios-informatique.fr>
+
+	* 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 <sandeep@codito.com>
 
 	* src/romfs.c (romfs_mount) : function wrongly returns ENOENT even
--- 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
     }
 }