Bug 454024 "ftp:///" (no hostname) gives an empty list of files instead of an error. r=jduell

This commit is contained in:
Tautvydas Andrikys 2010-07-21 23:43:11 +03:00
parent c8f536e878
commit 9d415704e0

View File

@ -1706,6 +1706,13 @@ nsFtpState::Init(nsFtpChannel *channel)
nsresult rv;
nsCAutoString path;
nsCOMPtr<nsIURL> url = do_QueryInterface(mChannel->URI());
nsCString host;
url->GetAsciiHost(host);
if (host.IsEmpty()) {
return NS_ERROR_MALFORMED_URI;
}
if (url) {
rv = url->GetFilePath(path);
} else {