|
Lines 80-86
Link Here
|
| 80 |
const int n; |
80 |
const int n; |
| 81 |
}; |
81 |
}; |
| 82 |
|
82 |
|
| 83 |
const struct CMD cmds[] = { |
83 |
const struct CMD sftp_cmds[] = { |
| 84 |
{ "bye", I_QUIT }, |
84 |
{ "bye", I_QUIT }, |
| 85 |
{ "cd", I_CHDIR }, |
85 |
{ "cd", I_CHDIR }, |
| 86 |
{ "chdir", I_CHDIR }, |
86 |
{ "chdir", I_CHDIR }, |
|
Lines 520-538
Link Here
|
| 520 |
return(-1); |
520 |
return(-1); |
| 521 |
|
521 |
|
| 522 |
/* Figure out which command we have */ |
522 |
/* Figure out which command we have */ |
| 523 |
for (i = 0; cmds[i].c; i++) { |
523 |
for (i = 0; sftp_cmds[i].c; i++) { |
| 524 |
int cmdlen = strlen(cmds[i].c); |
524 |
int cmdlen = strlen(sftp_cmds[i].c); |
| 525 |
|
525 |
|
| 526 |
/* Check for command followed by whitespace */ |
526 |
/* Check for command followed by whitespace */ |
| 527 |
if (!strncasecmp(cp, cmds[i].c, cmdlen) && |
527 |
if (!strncasecmp(cp, sftp_cmds[i].c, cmdlen) && |
| 528 |
strchr(WHITESPACE, cp[cmdlen])) { |
528 |
strchr(WHITESPACE, cp[cmdlen])) { |
| 529 |
cp += cmdlen; |
529 |
cp += cmdlen; |
| 530 |
cp = cp + strspn(cp, WHITESPACE); |
530 |
cp = cp + strspn(cp, WHITESPACE); |
| 531 |
break; |
531 |
break; |
| 532 |
} |
532 |
} |
| 533 |
} |
533 |
} |
| 534 |
cmdnum = cmds[i].n; |
534 |
cmdnum = sftp_cmds[i].n; |
| 535 |
cmd = cmds[i].c; |
535 |
cmd = sftp_cmds[i].c; |
| 536 |
|
536 |
|
| 537 |
/* Special case */ |
537 |
/* Special case */ |
| 538 |
if (*cp == '!') { |
538 |
if (*cp == '!') { |