summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/ftp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 6fb16b2..05f429b 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -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);
OpenPOWER on IntegriCloud