summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/media/ftp.subr
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-06-22 03:44:49 +0000
committerdteske <dteske@FreeBSD.org>2013-06-22 03:44:49 +0000
commit29cd5ea9dff1eea9a1e65fd6e6e9b44bef0fcbc8 (patch)
tree4bd17f353ba3eee152334f57e306ccdb9c0631f8 /usr.sbin/bsdconfig/share/media/ftp.subr
parent172bc62ff0d389029b29283372d5af7b28f8b574 (diff)
downloadFreeBSD-src-29cd5ea9dff1eea9a1e65fd6e6e9b44bef0fcbc8.zip
FreeBSD-src-29cd5ea9dff1eea9a1e65fd6e6e9b44bef0fcbc8.tar.gz
Trim the trailing `/' from the ftp_dir when validating that the directory
exists on the FTP server. This now means that when you specify a full-path to the repository on the FTP server that it doesn't matter whether you have a trailing `/' or not.
Diffstat (limited to 'usr.sbin/bsdconfig/share/media/ftp.subr')
-rw-r--r--usr.sbin/bsdconfig/share/media/ftp.subr5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/bsdconfig/share/media/ftp.subr b/usr.sbin/bsdconfig/share/media/ftp.subr
index 3c2cba9..798ced0 100644
--- a/usr.sbin/bsdconfig/share/media/ftp.subr
+++ b/usr.sbin/bsdconfig/share/media/ftp.subr
@@ -659,7 +659,10 @@ f_media_init_ftp()
break # to failure
fi
if echo "$rx" | awk -v dir="/${ftp_dir#/}" '
- BEGIN { found = 0 }
+ BEGIN {
+ found = 0
+ sub("/$", "", dir)
+ }
/^Remote directory: / {
sub(/^[^:]*:[[:space:]]*/, "")
if ($0 != dir) next
OpenPOWER on IntegriCloud