Fix the case where the file name is preceded by a lone slash.
This commit is contained in:
parent
23f6448485
commit
a260febdf9
@ -217,7 +217,7 @@ _ftp_cwd(int cd, char *file)
|
||||
char *s;
|
||||
int e;
|
||||
|
||||
if ((s = strrchr(file, '/')) == NULL) {
|
||||
if ((s = strrchr(file, '/')) == NULL || s == file) {
|
||||
e = _ftp_cmd(cd, "CWD /");
|
||||
} else {
|
||||
e = _ftp_cmd(cd, "CWD %.*s", s - file, file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user