From a624250733a2883aeeba3e55eed0096472814168 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 18 Jul 2011 01:47:48 +0000 Subject: Documentation update git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3795 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/fs/fat/fs_fat32dirent.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'nuttx/fs') diff --git a/nuttx/fs/fat/fs_fat32dirent.c b/nuttx/fs/fat/fs_fat32dirent.c index b64ab87e3..8ba3d3a69 100644 --- a/nuttx/fs/fat/fs_fat32dirent.c +++ b/nuttx/fs/fat/fs_fat32dirent.c @@ -941,28 +941,18 @@ static bool fat_cmplfname(const uint8_t *direntry, const uint8_t *substr) chunk = LDIR_PTRWCHAR1_5(direntry); match = fat_cmplfnchunk(chunk, substr, 5); - if (match) + if (match && len > 5) { - /* Don't go past the end of the sub-string */ + /* Check bytes 6-11 */ - if (len > 5) + chunk = LDIR_PTRWCHAR6_11(direntry); + match = fat_cmplfnchunk(chunk, &substr[5], 6); + if (match && len > 11) { - /* Check bytes 6-11 */ + /* Check bytes 12-13 */ - chunk = LDIR_PTRWCHAR6_11(direntry); - match = fat_cmplfnchunk(chunk, &substr[5], 6); - if (match) - { - /* Don't go past the end of the sub-string */ - - if (len > 11) - { - /* Check bytes 12-13 */ - - chunk = LDIR_PTRWCHAR12_13(direntry); - match = fat_cmplfnchunk(chunk, &substr[11], 2); - } - } + chunk = LDIR_PTRWCHAR12_13(direntry); + match = fat_cmplfnchunk(chunk, &substr[11], 2); } } -- cgit v1.2.3