Fiddling with x86_64 and i486 builds
[tpg/acess2.git] / Modules / Filesystems / FAT / fat.c
index 381a7ec..5502b5a 100644 (file)
@@ -1262,7 +1262,8 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                // Bit 6 indicates the start of an entry\r
                if(lfnInfo->id & 0x40)  memset(lfn, 0, 256);\r
                \r
-               a = (lfnInfo->id & 0x3F) * 13;\r
+               a = ((lfnInfo->id & 0x3F) - 1) * 13;\r
+               //Log_Debug("FAT", "ID = 0x%02x, a = %i", lfnInfo->id, a);\r
                \r
                // Sanity Check (FAT implementations should not allow >255 character names)\r
                if(a > 255)     return VFS_SKIP;\r
@@ -1276,6 +1277,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
                lfn[a+ 9] = lfnInfo->name2[4];  lfn[a+10] = lfnInfo->name2[5];\r
                lfn[a+11] = lfnInfo->name3[0];  lfn[a+12] = lfnInfo->name3[1];\r
                LOG("lfn = '%s'", lfn);\r
+               //Log_Debug("FAT", "lfn = '%s'", lfn);\r
                LEAVE('p', VFS_SKIP);\r
                return VFS_SKIP;\r
        }\r
@@ -1304,6 +1306,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID)
        \r
        #if USE_LFN\r
        lfn = FAT_int_GetLFN(Node, ID);\r
+       //Log_Debug("FAT", "lfn = %p'%s'", lfn, lfn);\r
        ret = FAT_int_CreateName(&fileinfo[a], lfn);\r
        #else\r
        ret = FAT_int_CreateName(&fileinfo[a], NULL);\r

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