summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-07-20 02:03:56 +0000
committerdes <des@FreeBSD.org>2000-07-20 02:03:56 +0000
commita260febdf9a88b98088a64af2f0a3bee88ef86ce (patch)
treef98d3c58456f340422650733a55083554dbcfd6f /lib/libfetch
parent23f64484857687c3f927f9b7557805b2b3f83fb8 (diff)
downloadFreeBSD-src-a260febdf9a88b98088a64af2f0a3bee88ef86ce.zip
FreeBSD-src-a260febdf9a88b98088a64af2f0a3bee88ef86ce.tar.gz
Fix the case where the file name is preceded by a lone slash.
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