/programs/system/shell/globals.h |
---|
1,5 → 1,5 |
#define SHELL_VERSION "0.6.3" |
#define SHELL_VERSION "0.6.4" |
extern char PATH[256]; |
extern char PARAM[256]; |
/programs/system/shell/shell.c |
---|
128,10 → 128,16 |
ALIASES = malloc(128*1024); |
if (strlen(PARAM) > 0) |
if (PARAM[0] == 0) strcpy(CMD, ".shell"); |
else |
{ |
if (PARAM[0] == '/') |
{ |
strcpy(cur_dir, PARAM); |
*strrchr(cur_dir, '/')=0; |
} |
strcpy(CMD, PARAM); |
else |
strcpy(CMD, ".shell"); |
} |
command_execute(); |
/programs/system/shell/system/string.c |
---|
123,7 → 123,22 |
} |
char* strrchr(const char* string, int c) |
{ |
int last_found; |
while (*string) |
{ |
if (*string==c) |
{ |
last_found = string; |
} |
string++; |
} |
return (char*)last_found; |
} |
void _itoa(int i, char *s) |
{ |
int a, b, c, d; |
/programs/system/shell/system/string.h |
---|
13,6 → 13,7 |
char* strncpy(char *strDest, const char *strSource, unsigned n); |
int strlen(const char* string); |
char* strchr(const char* string, int c); |
char* strrchr(const char* string, int c); |
void _itoa(int i, char *s); |
void reverse(char *s); |
void itoa(int i, char *s); |