// === CONSTANTS ===
const Uint16 caVT100Colours[] = {
- VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, VT_COL_LTGREY,
+ VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, 0x777,
VT_COL_GREY, 0xF00, 0x0F0, 0xFF0, 0x00F, 0xF0F, 0x0FF, VT_COL_WHITE
};
{
case 0: return; // Ignore NULL byte
case '\n':
- LOG("%i += %i", Term->WritePos, Term->Width);
Term->WritePos += Term->Width;
case '\r':
Term->WritePos -= Term->WritePos % Term->Width;
int i;
tVFS_Handle *h = VFS_GetHandle(FD);
- ENTER("ph pDest", h, Dest);
-
// Error check
if(!h) {
- LEAVE('i', -1);
return -1;
}
- LOG("h->Node = %p", h->Node);
-
// Root can do anything
if(Dest->Group == 0 && Dest->ID == 0) {
Dest->Inv = 0;
Dest->Perms = -1;
- LEAVE('i', 1);
return 1;
}
if( h->Node->NumACLs == 0 ) {
Dest->Inv = 0;
Dest->Perms = 0;
- LEAVE('i', 0);
return 0;
}
Dest->Inv = h->Node->ACLs[i].Inv;
Dest->Perms = h->Node->ACLs[i].Perms;
- LEAVE('i', 1);
return 1;
}
Dest->Inv = 0;
Dest->Perms = 0;
- LEAVE('i', 0);
return 0;
}
};
tVFS_Node gDevFS_RootNode = {
.NumACLs = 1,
+ .Flags = VFS_FFLAG_DIRECTORY,
.ACLs = &gVFS_ACL_EveryoneRW,
.ReadDir = DevFS_ReadDir,
.FindDir = DevFS_FindDir
if( !(Mode & VFS_OPENFLAG_NOLINK) && (node->Flags & VFS_FFLAG_SYMLINK) )
{
if( !node->Read ) {
- LOG("No read method on symlink");
+ Warning("No read method on symlink");
LEAVE('i', -1);
return -1;
}
\r
// ==== LOCAL VARIABLES ====\r
char gsCommandBuffer[1024];\r
-char *gsCurrentDirectory = "/";\r
+char *gsCurrentDirectory = NULL;\r
char gsTmpBuffer[1024];\r
char **gasCommandHistory;\r
int giLastCommand = 0;\r
\r
//Command_Clear(0, NULL);\r
\r
+ {\r
+ char *tmp = getenv("CWD");\r
+ if(tmp) {\r
+ gsCurrentDirectory = malloc(strlen(tmp)+1);\r
+ strcpy(gsCurrentDirectory, tmp);\r
+ } else {\r
+ gsCurrentDirectory = malloc(2);\r
+ strcpy(gsCurrentDirectory, "/");\r
+ }\r
+ } \r
+ \r
write(_stdout, 1, "\n");\r
- write(_stdout, 36, "Acess Shell Version 3\n");\r
+ write(_stdout, 22, "Acess Shell Version 3\n");\r
write(_stdout, 2, "\n");\r
for(;;)\r
{\r
if(saArgs[0]) free(saArgs);\r
if(!bCached) free(sCommandStr);\r
bCached = 0;\r
+ write(_stdout, 1, "\n");\r
write(_stdout, strlen(gsCurrentDirectory), gsCurrentDirectory);\r
write(_stdout, 3, "$ ");\r
\r
return;\r
}\r
\r
+ free(gsCurrentDirectory);\r
+ gsCurrentDirectory = malloc(strlen(tmpPath)+1);\r
strcpy(gsCurrentDirectory, tmpPath);\r
}\r
\r