summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/ftp.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2006-06-13 10:19:59 +0000
committerdes <des@FreeBSD.org>2006-06-13 10:19:59 +0000
commita5357a7c3fd7ec5710e8ba2a0a47e2c57916f368 (patch)
treeae02d3f6129ef7a657063d818eb1e72bf9f3234c /lib/libfetch/ftp.c
parent9e9a1ba51330635bfd50a15d1fcc1da17615ffef (diff)
downloadFreeBSD-src-a5357a7c3fd7ec5710e8ba2a0a47e2c57916f368.zip
FreeBSD-src-a5357a7c3fd7ec5710e8ba2a0a47e2c57916f368.tar.gz
Fix a bug introduced in rev 1.92, where, when changing from one directory
to another, the first CWD after a string of CDUPs would incorrectly include a slash before the directory name. Reported by: obrien PR: bin/83278
Diffstat (limited to 'lib/libfetch/ftp.c')
-rw-r--r--lib/libfetch/ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index cd8ff0d..6116593 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -294,6 +294,8 @@ _ftp_cwd(conn_t *conn, const char *file)
}
}
for (beg = file + i; beg < end; beg = file + i + 1) {
+ while (*beg == '/')
+ ++beg, ++i;
for (++i; file + i < end && file[i] != '/'; ++i)
/* nothing */ ;
e = _ftp_cmd(conn, "CWD %.*s", file + i - beg, beg);
OpenPOWER on IntegriCloud