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

This commit is contained in:
Dag-Erling Smørgrav 2000-07-20 02:03:56 +00:00
parent b31edf0c1b
commit 5e3f46b51a

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