diff options
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r-- | apt-pkg/deb/debmetaindex.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 71b208622..8b4430c9d 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -921,8 +921,11 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/ UseByHash = _config->Find("Acquire::By-Hash", UseByHash); { std::string const host = ::URI(URI).Host; - UseByHash = _config->Find("APT::Acquire::" + host + "::By-Hash", UseByHash); - UseByHash = _config->Find("Acquire::" + host + "::By-Hash", UseByHash); + if (host.empty() == false) + { + UseByHash = _config->Find("APT::Acquire::" + host + "::By-Hash", UseByHash); + UseByHash = _config->Find("Acquire::" + host + "::By-Hash", UseByHash); + } std::map<std::string, std::string>::const_iterator const opt = Options.find("by-hash"); if (opt != Options.end()) UseByHash = opt->second; |