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 69cf0a48ad9e424d7fc53890683cc1af61682e87..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;
}