X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2FCLIShell_src%2Fmain.c;h=58432daf2cd985655086792a2ba09174d6ff0b7f;hb=0542d0b19b79f6439ace9c0f9e35ec29a8af91f9;hp=33907eeeb115a79e75528e5f52436829cf8555aa;hpb=fe2794b4f932c0755674493b6a6da4b60a5c2433;p=tpg%2Facess2.git diff --git a/Usermode/Applications/CLIShell_src/main.c b/Usermode/Applications/CLIShell_src/main.c index 33907eee..58432daf 100644 --- a/Usermode/Applications/CLIShell_src/main.c +++ b/Usermode/Applications/CLIShell_src/main.c @@ -77,8 +77,7 @@ int main(int argc, char *argv[], char *envp[]) } } - write(_stdout, 22, "Acess Shell Version 3\n"); - write(_stdout, 2, "\n"); + printf("Acess Shell Version 3\n\n"); for(;;) { // Free last command & arguments @@ -88,18 +87,18 @@ int main(int argc, char *argv[], char *envp[]) bCached = 0; #endif - write(_stdout, strlen(gsCurrentDirectory), gsCurrentDirectory); - write(_stdout, 2, "$ "); + printf("%s$ ", gsCurrentDirectory); // Read Command line #if USE_READLINE sCommandStr = Readline( readline_state ); + printf("\n"); length = strlen(sCommandStr); #else sCommandStr = ReadCommandLine( &length ); if(!sCommandStr) { - write(_stdout, 25, "PANIC: Out of heap space\n"); + printf("PANIC: Out of heap space\n"); return -1; } @@ -146,6 +145,7 @@ int main(int argc, char *argv[], char *envp[]) } } +#if !USE_READLINE /** * \fn char *ReadCommandLine(int *Length) * \brief Read from the command line @@ -166,21 +166,20 @@ char *ReadCommandLine(int *Length) // Read In Command Line do { - read(_stdin, 1, &ch); // Read Character from stdin (read is a blocking call) - + ch = getchar(); // Read Character from stdin (read is a blocking call) if(ch == '\n') break; switch(ch) { // Control characters case '\x1B': - read(_stdin, 1, &ch); // Read control character + ch = getchar(); // Read control character switch(ch) { //case 'D': if(pos) pos--; break; //case 'C': if(pos