forked from KolibriOS/kolibrios
SHELL 0.6.4: relative passes support for scripts
git-svn-id: svn://kolibrios.org@3988 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b9625388ab
commit
88ac946b40
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#define SHELL_VERSION "0.6.3"
|
#define SHELL_VERSION "0.6.4"
|
||||||
|
|
||||||
extern char PATH[256];
|
extern char PATH[256];
|
||||||
extern char PARAM[256];
|
extern char PARAM[256];
|
||||||
|
@ -128,10 +128,16 @@ con_set_cursor_height(con_get_font_height()-1);
|
|||||||
|
|
||||||
ALIASES = malloc(128*1024);
|
ALIASES = malloc(128*1024);
|
||||||
|
|
||||||
if (strlen(PARAM) > 0)
|
if (PARAM[0] == 0) strcpy(CMD, ".shell");
|
||||||
strcpy(CMD, PARAM);
|
|
||||||
else
|
else
|
||||||
strcpy(CMD, ".shell");
|
{
|
||||||
|
if (PARAM[0] == '/')
|
||||||
|
{
|
||||||
|
strcpy(cur_dir, PARAM);
|
||||||
|
*strrchr(cur_dir, '/')=0;
|
||||||
|
}
|
||||||
|
strcpy(CMD, PARAM);
|
||||||
|
}
|
||||||
|
|
||||||
command_execute();
|
command_execute();
|
||||||
|
|
||||||
|
@ -123,6 +123,21 @@ char* strchr(const char* string, int c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
void _itoa(int i, char *s)
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,8 @@ void strcpy(char strDest[], const char strSource[]);
|
|||||||
char* strncpy(char *strDest, const char *strSource, unsigned n);
|
char* strncpy(char *strDest, const char *strSource, unsigned n);
|
||||||
int strlen(const char* string);
|
int strlen(const char* string);
|
||||||
char* strchr(const char* string, int c);
|
char* strchr(const char* string, int c);
|
||||||
|
char* strrchr(const char* string, int c);
|
||||||
void _itoa(int i, char *s);
|
void _itoa(int i, char *s);
|
||||||
void reverse(char *s);
|
void reverse(char *s);
|
||||||
void itoa(int i, char *s);
|
void itoa(int i, char *s);
|
||||||
int _atoi ( char *s );
|
int _atoi( char *s );
|
||||||
|
Loading…
Reference in New Issue
Block a user