projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix directory look up.
[yaffs2.git]
/
direct
/
yaffsfs.c
diff --git
a/direct/yaffsfs.c
b/direct/yaffsfs.c
index eab6c496482dc30c04edcdee0174bb3304a1e5cd..dedd76ca08138e26bb0b0c9573f53111a7e36652 100644
(file)
--- a/
direct/yaffsfs.c
+++ b/
direct/yaffsfs.c
@@
-515,17
+515,17
@@
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path,
thisMatchLength = 0;
matching = 1;
thisMatchLength = 0;
matching = 1;
+
if(!p)
continue;
if(!p)
continue;
- while (matching && *p && *leftOver) {
- /* Skip over any /s */
- while (yaffsfs_IsPathDivider(*p))
- p++;
+ /* Skip over any leading /s */
+ while (yaffsfs_IsPathDivider(*p))
+ p++;
+ while (yaffsfs_IsPathDivider(*leftOver))
+ leftOver++;
- /* Skip over any /s */
- while (yaffsfs_IsPathDivider(*leftOver))
- leftOver++;
+ while (matching && *p && *leftOver) {
/* Now match the text part */
while (matching &&
/* Now match the text part */
while (matching &&
@@
-539,6
+539,16
@@
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path,
matching = 0;
}
}
matching = 0;
}
}
+
+ if ((*p && !yaffsfs_IsPathDivider(*p)) ||
+ (*leftOver && !yaffsfs_IsPathDivider(*leftOver)))
+ matching = 0;
+ else {
+ while (yaffsfs_IsPathDivider(*p))
+ p++;
+ while (yaffsfs_IsPathDivider(*leftOver))
+ leftOver++;
+ }
}
/* Skip over any /s in leftOver */
}
/* Skip over any /s in leftOver */
@@
-559,7
+569,6
@@
static struct yaffs_dev *yaffsfs_FindDevice(const YCHAR *path,
retval = dev;
longestMatch = thisMatchLength;
}
retval = dev;
longestMatch = thisMatchLength;
}
-
}
return retval;
}
}
return retval;
}
@@
-3464,6
+3473,12
@@
yaffs_DIR *yaffs_opendir_reldir(struct yaffs_obj *reldir, const YCHAR *dirname)
yaffsfs_Unlock();
return ret;
}
yaffsfs_Unlock();
return ret;
}
+
+yaffs_DIR *yaffs_opendir_reldev(struct yaffs_dev *dev, const YCHAR *dirname)
+{
+ return yaffs_opendir_reldir(ROOT_DIR(dev), dirname);
+}
+
yaffs_DIR *yaffs_opendir(const YCHAR *dirname)
{
return yaffs_opendir_reldir(NULL, dirname);
yaffs_DIR *yaffs_opendir(const YCHAR *dirname)
{
return yaffs_opendir_reldir(NULL, dirname);