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.
This commit is contained in:
dteske 2013-06-22 03:44:49 +00:00
parent 172bc62ff0
commit 29cd5ea9df

View File

@ -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