thisMatchLength = 0;
matching = 1;
+
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 &&
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 */
retval = dev;
longestMatch = thisMatchLength;
}
-
}
return retval;
}
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);