Misc fiddling with FAT driver (LFN and ReadDir)
authorJohn Hodge <[email protected]>
Fri, 29 Oct 2010 08:08:28 +0000 (16:08 +0800)
committerJohn Hodge <[email protected]>
Fri, 29 Oct 2010 08:08:28 +0000 (16:08 +0800)
Modules/Filesystems/FAT/fat.c

index 911b26e..381a7ec 100644 (file)
@@ -912,6 +912,7 @@ char *FAT_int_CreateName(fat_filetable *ft, char *LongFileName)
 {\r
        char    *ret;\r
        ENTER("pft sLongFileName", ft, LongFileName);\r
+       //Log_Debug("FAT", "FAT_int_CreateName(ft=%p, LongFileName=%p'%s')", ft, LongFileName);\r
        #if USE_LFN\r
        if(LongFileName && LongFileName[0] != '\0')\r
        {       \r
@@ -1259,14 +1260,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                lfn = FAT_int_GetLFN( Node, ID + (lfnInfo->id & 0x3F) );\r
                \r
                // Bit 6 indicates the start of an entry\r
-               if(lfnInfo->id & 0x40) {\r
-                       //Log_Debug("FAT", "lfn = %p", lfn);\r
-                       //Heap_Validate();\r
-                       //Log_Debug("FAT", "Clearing LFN");\r
-                       memset(lfn, 0, 256);\r
-                       //Heap_Validate();\r
-                       //Log_Debug("FAT", "Check Passed");\r
-               }\r
+               if(lfnInfo->id & 0x40)  memset(lfn, 0, 256);\r
                \r
                a = (lfnInfo->id & 0x3F) * 13;\r
                \r
@@ -1292,11 +1286,16 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                LEAVE('p', VFS_SKIP);\r
                return VFS_SKIP;\r
        }\r
-       // Ignore . and ..\r
-       if(fileinfo[a].name[0] == '.') {\r
+       // Ignore .\r
+       if(fileinfo[a].name[0] == '.' && fileinfo[a].name[1] == ' ') {\r
                LEAVE('p', VFS_SKIP);\r
                return VFS_SKIP;\r
-       }       \r
+       }\r
+       // and ..\r
+       if(fileinfo[a].name[0] == '.' && fileinfo[a].name[1] == '.' && fileinfo[a].name[2] == ' ') {\r
+               LEAVE('p', VFS_SKIP);\r
+               return VFS_SKIP;\r
+       }\r
        \r
        LOG("name='%c%c%c%c%c%c%c%c.%c%c%c'",\r
                fileinfo[a].name[0], fileinfo[a].name[1], fileinfo[a].name[2], fileinfo[a].name[3],\r

UCC git Repository :: git.ucc.asn.au