Fix the case where the file name is preceded by a lone slash.

This commit is contained in:
des 2000-07-20 02:03:56 +00:00
parent 23f6448485
commit a260febdf9

View File

@ -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);