summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/acquire-item.cc3
-rw-r--r--test/interactive-helper/aptwebserver.cc2
2 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 34528f2ec..a4ad6b854 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -3860,7 +3860,8 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringLis
DestFile = flNotDir(URI);
::URI url{URI};
- url.Path = pkgAcquire::URIEncode(url.Path);
+ if (url.Path.find(' ') != std::string::npos || url.Path.find('%') == std::string::npos)
+ url.Path = pkgAcquire::URIEncode(url.Path);
// Create the item
Desc.URI = std::string(url);
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc
index 57d215a65..58ba54f84 100644
--- a/test/interactive-helper/aptwebserver.cc
+++ b/test/interactive-helper/aptwebserver.cc
@@ -630,7 +630,7 @@ static bool handleOnTheFlyReconfiguration(std::ostream &log, int const client,/*
size_t const pcount = EncodedParts.size();
std::vector<std::string> parts(pcount);
for (size_t i = 0; i < pcount; ++i)
- parts[i] = DeQuoteString(DeQuoteString(EncodedParts[i]));
+ parts[i] = DeQuoteString(EncodedParts[i]);
if (pcount == 4 && parts[1] == "set")
{
_config->Set(parts[2], parts[3]);