#define VFS_MAXSKIP ((void*)1024)
#define VFS_SKIP ((void*)1)
#define VFS_SKIPN(n) ((void*)(n))
+#define VFS_FREEPLZ(ptr) ((void*)(((Uint)ptr)|1))
extern tVFS_Node NULLNode;
extern tVFS_ACL gVFS_ACL_EveryoneRWX;
extern tVFS_ACL gVFS_ACL_EveryoneRW;
// Get the current length\r
len = strlen(lfn);\r
\r
- // Sanity Check (FAT implementations do not allow >255 bytes)\r
+ // Sanity Check (FAT implementations should not allow >255 bytes)\r
if(len + 13 > 255) return VFS_SKIP;\r
// Rebase all bytes\r
for(a=len+1;a--;) lfn[a+13] = lfn[a];\r
#endif\r
\r
LEAVE('s', ret);\r
- return ret;\r
+ return VFS_FREEPLZ(ret);\r
}\r
\r
/**\r
// Get File Stats\r
finfo(fp, &info, 0);\r
\r
- //Print Mode\r
- //#if 0\r
+ if(info.flags & FILEFLAG_DIRECTORY)\r
+ write(_stdout, 1, "d");\r
+ else\r
+ write(_stdout, 1, "-");\r
+ \r
+ // Print Mode\r
acl.group = 0; acl.id = info.uid;\r
_SysGetACL(fp, &acl);\r
if(acl.perms & 1) modeStr[0] = 'r'; else modeStr[0] = '-';\r
if(acl.perms & 1) modeStr[7] = 'w'; else modeStr[7] = '-';\r
if(acl.perms & 1) modeStr[8] = 'x'; else modeStr[8] = '-';\r
write(_stdout, 10, modeStr);\r
- //#endif\r
close(fp);\r
\r
// Colour Code\r
if(info.flags & FILEFLAG_DIRECTORY) // Directory: Green\r
write(_stdout, 6, "\x1B[32m");\r
- else\r
- write(_stdout, 6, "\x1B[37m"); // Default: White\r
+ // Default: White\r
+ \r
// Print Name\r
write(_stdout, strlen(fileName), fileName);\r
+ \r
// Print slash if applicable\r
if(info.flags & FILEFLAG_DIRECTORY)\r
write(_stdout, 1, "/");\r
// Revert Colour\r
write(_stdout, 6, "\x1B[37m");\r
\r
- // Put Size\r
- printf("\n", info.size);\r
- \r
- //write(_stdout, 1, "\n");\r
+ // Newline!\r
+ write(_stdout, 1, "\n");\r
}\r
// Close Directory\r
close(dp);\r