X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FFilesystems%2FFAT%2Ffat.c;fp=Modules%2FFilesystems%2FFAT%2Ffat.c;h=381a7ecf676a263536ebc83b49e96a5572b51f9b;hb=7584f0ce4bf47b67ef408afe947ee8a00999a4fc;hp=911b26e48e62b44fbbb47d798661877260002423;hpb=a9f5c2be879ab67080122aaabe83a7ae897126bb;p=tpg%2Facess2.git diff --git a/Modules/Filesystems/FAT/fat.c b/Modules/Filesystems/FAT/fat.c index 911b26e4..381a7ecf 100644 --- a/Modules/Filesystems/FAT/fat.c +++ b/Modules/Filesystems/FAT/fat.c @@ -912,6 +912,7 @@ char *FAT_int_CreateName(fat_filetable *ft, char *LongFileName) { char *ret; ENTER("pft sLongFileName", ft, LongFileName); + //Log_Debug("FAT", "FAT_int_CreateName(ft=%p, LongFileName=%p'%s')", ft, LongFileName); #if USE_LFN if(LongFileName && LongFileName[0] != '\0') { @@ -1259,14 +1260,7 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) lfn = FAT_int_GetLFN( Node, ID + (lfnInfo->id & 0x3F) ); // Bit 6 indicates the start of an entry - if(lfnInfo->id & 0x40) { - //Log_Debug("FAT", "lfn = %p", lfn); - //Heap_Validate(); - //Log_Debug("FAT", "Clearing LFN"); - memset(lfn, 0, 256); - //Heap_Validate(); - //Log_Debug("FAT", "Check Passed"); - } + if(lfnInfo->id & 0x40) memset(lfn, 0, 256); a = (lfnInfo->id & 0x3F) * 13; @@ -1292,11 +1286,16 @@ char *FAT_ReadDir(tVFS_Node *Node, int ID) LEAVE('p', VFS_SKIP); return VFS_SKIP; } - // Ignore . and .. - if(fileinfo[a].name[0] == '.') { + // Ignore . + if(fileinfo[a].name[0] == '.' && fileinfo[a].name[1] == ' ') { LEAVE('p', VFS_SKIP); return VFS_SKIP; - } + } + // and .. + if(fileinfo[a].name[0] == '.' && fileinfo[a].name[1] == '.' && fileinfo[a].name[2] == ' ') { + LEAVE('p', VFS_SKIP); + return VFS_SKIP; + } LOG("name='%c%c%c%c%c%c%c%c.%c%c%c'", fileinfo[a].name[0], fileinfo[a].name[1], fileinfo[a].name[2], fileinfo[a].name[3],