Back out a portion of the last FAT LFN change
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3986 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
c4b3e3185f
commit
f47d7adcd4
@ -1123,31 +1123,25 @@ static bool fat_cmplfname(const uint8_t *direntry, const uint8_t *substr)
|
|||||||
int len;
|
int len;
|
||||||
bool match;
|
bool match;
|
||||||
|
|
||||||
/* How much of string do we have to compare? */
|
/* How much of string do we have to compare? (including the NUL
|
||||||
|
* terminator).
|
||||||
|
*/
|
||||||
|
|
||||||
len = strlen((char*)substr);
|
len = strlen((char*)substr) + 1;
|
||||||
|
|
||||||
/* Check bytes 1-5 */
|
/* Check bytes 1-5 */
|
||||||
|
|
||||||
chunk = LDIR_PTRWCHAR1_5(direntry);
|
chunk = LDIR_PTRWCHAR1_5(direntry);
|
||||||
match = fat_cmplfnchunk(chunk, substr, 5);
|
match = fat_cmplfnchunk(chunk, substr, 5);
|
||||||
if (match && len >= 5)
|
if (match && len > 5)
|
||||||
{
|
{
|
||||||
/* Check bytes 6-11. Note that if len == 5, the substring passed to
|
/* Check bytes 6-11 */
|
||||||
* fat_cmplfnchunk() will point to the NUL terminator of substr.
|
|
||||||
* In this case, fat_cmplfnchunk() will only verify that the
|
|
||||||
* directory entry is also NUL terminated.
|
|
||||||
*/
|
|
||||||
|
|
||||||
chunk = LDIR_PTRWCHAR6_11(direntry);
|
chunk = LDIR_PTRWCHAR6_11(direntry);
|
||||||
match = fat_cmplfnchunk(chunk, &substr[5], 6);
|
match = fat_cmplfnchunk(chunk, &substr[5], 6);
|
||||||
if (match && len >= 11)
|
if (match && len > 11)
|
||||||
{
|
{
|
||||||
/* Check bytes 12-13. Note that if len == 11, the substring passed to
|
/* Check bytes 12-13 */
|
||||||
* fat_cmplfnchunk() will point to the NUL terminator of substr.
|
|
||||||
* In this case, fat_cmplfnchunk() will only verify that the
|
|
||||||
* directory entry is also NUL terminated.
|
|
||||||
*/
|
|
||||||
|
|
||||||
chunk = LDIR_PTRWCHAR12_13(direntry);
|
chunk = LDIR_PTRWCHAR12_13(direntry);
|
||||||
match = fat_cmplfnchunk(chunk, &substr[11], 2);
|
match = fat_cmplfnchunk(chunk, &substr[11], 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user