Added `strdup` library function and removed VFS_FREEPLZ, also added valid tVFS_Node...
[tpg/acess2.git] / Kernel / vfs / fs / fat.c
index c0c3fba..8a55827 100644 (file)
@@ -8,7 +8,7 @@
 #include <vfs.h>\r
 #include "fs_fat.h"\r
 \r
-#define DEBUG  1\r
+#define DEBUG  0\r
 #define VERBOSE        1\r
 \r
 #if DEBUG\r
@@ -489,8 +489,6 @@ tVFS_Node *FAT_int_CreateNode(tVFS_Node *parent, fat_filetable *ft, char *LongFi
        \r
        ENTER("pParent pFT sLongFileName", parent, ft, LongFileName);\r
        \r
-       // Get Name\r
-       //node.Name = FAT_int_CreateName(parent, ft, LongFileName);\r
        // Set Other Data\r
        node.Inode = ft->cluster | (ft->clusterHi<<16);\r
        node.Size = ft->size;\r
@@ -529,6 +527,7 @@ tVFS_Node *FAT_int_CreateNode(tVFS_Node *parent, fat_filetable *ft, char *LongFi
                node.ReadDir = FAT_ReadDir;\r
                node.FindDir = FAT_FindDir;\r
                node.MkNod = FAT_Mknod;\r
+               node.Size = -1;\r
        } else {\r
                node.Read = FAT_Read;\r
                node.Write = FAT_Write;\r
@@ -666,16 +665,16 @@ char *FAT_ReadDir(tVFS_Node *dirNode, int dirpos)
        // Offset in sector\r
        a = dirpos & 0xF;\r
 \r
-       LOG("offset=%i, a=%i\n", (Uint)offset, a);\r
+       LOG("offset=%i, a=%i", (Uint)offset, a);\r
        \r
        // Read Sector\r
        VFS_ReadAt(disk->fileHandle, offset*512, 512, fileinfo);        // Read Dir Data\r
        \r
-       LOG("name[0] = 0x%x\n", (Uint8)fileinfo[a].name[0]);\r
+       LOG("name[0] = 0x%x", (Uint8)fileinfo[a].name[0]);\r
        //Check if this is the last entry\r
        if(fileinfo[a].name[0] == '\0') {\r
                dirNode->Size = dirpos;\r
-               LOG("End of list\n");\r
+               LOG("End of list");\r
                LEAVE('n');\r
                return NULL;    // break\r
        }\r
@@ -744,7 +743,7 @@ char *FAT_ReadDir(tVFS_Node *dirNode, int dirpos)
        #endif\r
        \r
        LEAVE('s', ret);\r
-       return VFS_FREEPLZ(ret);\r
+       return ret;\r
 }\r
 \r
 /**\r

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