Login new
This commit is contained in:
30
login.c
30
login.c
@@ -23,6 +23,18 @@
|
|||||||
static uint8 script_login_name[64];
|
static uint8 script_login_name[64];
|
||||||
static uint8 script_file_server[52];
|
static uint8 script_file_server[52];
|
||||||
|
|
||||||
|
#if defined(__WATCOMC__)
|
||||||
|
extern void textbackground(int color);
|
||||||
|
extern void textcolor(int color);
|
||||||
|
extern void clrscr(void);
|
||||||
|
extern void gotoxy(int x, int y);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern char **build_argv(char *buf, int bufsize, char *str);
|
||||||
|
extern int read_command_file(char *fstr);
|
||||||
|
extern int get_fs_name(int connid, char *name);
|
||||||
|
|
||||||
|
|
||||||
static int login_help(void)
|
static int login_help(void)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
||||||
@@ -193,6 +205,20 @@ static int script_eval_if(char *line)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int login_strnicmp(char *a, char *b, int n)
|
||||||
|
{
|
||||||
|
while (n-- > 0) {
|
||||||
|
int ca = *a++;
|
||||||
|
int cb = *b++;
|
||||||
|
if (ca >= 'a' && ca <= 'z') ca -= 32;
|
||||||
|
if (cb >= 'a' && cb <= 'z') cb -= 32;
|
||||||
|
if (ca != cb) return(ca - cb);
|
||||||
|
if (!ca) return(0);
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
static int script_execute_line(char *line)
|
static int script_execute_line(char *line)
|
||||||
{
|
{
|
||||||
char work[512];
|
char work[512];
|
||||||
@@ -265,7 +291,7 @@ static int script_execute_line(char *line)
|
|||||||
if (!strncmp(up, "INS ", 4) || !strncmp(up, "INSERT ", 7)) {
|
if (!strncmp(up, "INS ", 4) || !strncmp(up, "INSERT ", 7)) {
|
||||||
char callbuf[512];
|
char callbuf[512];
|
||||||
char *a = arg;
|
char *a = arg;
|
||||||
if (!strnicmp(up, "INS ", 4)) a += 4;
|
if (!login_strnicmp(up, "INS ", 4)) a += 4;
|
||||||
else a += 7;
|
else a += 7;
|
||||||
sprintf(callbuf, "PATHINS %s", skip_spaces(a));
|
sprintf(callbuf, "PATHINS %s", skip_spaces(a));
|
||||||
script_call_line(callbuf);
|
script_call_line(callbuf);
|
||||||
@@ -275,7 +301,7 @@ static int script_execute_line(char *line)
|
|||||||
if (!strncmp(up, "DEL ", 4) || !strncmp(up, "DELETE ", 7)) {
|
if (!strncmp(up, "DEL ", 4) || !strncmp(up, "DELETE ", 7)) {
|
||||||
char callbuf[512];
|
char callbuf[512];
|
||||||
char *a = arg;
|
char *a = arg;
|
||||||
if (!strnicmp(up, "DEL ", 4)) a += 4;
|
if (!login_strnicmp(up, "DEL ", 4)) a += 4;
|
||||||
else a += 7;
|
else a += 7;
|
||||||
sprintf(callbuf, "PATHDEL %s", skip_spaces(a));
|
sprintf(callbuf, "PATHDEL %s", skip_spaces(a));
|
||||||
script_call_line(callbuf);
|
script_call_line(callbuf);
|
||||||
|
|||||||
Reference in New Issue
Block a user