summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-05-27 18:10:39 +0200
committerJulian Andres Klode <jak@debian.org>2016-06-01 14:24:33 +0200
commit55c6402be4297d644de774b1fef70b88f91a73e9 (patch)
tree667cd179c731fe69b139b46ed4b3d2a13deee672 /apt-private
parentb1b149ca440d954bb8a52b30cf16e84cd82c7fbc (diff)
prevent C++ locale number formatting in text APIs
Setting the C++ locale via std::locale::global(std::locale("")); which would otherwise default to the default C locale (aka: unaffected by setlocale) effects the formatting of numeric types in IO streams, which for output for humans is perfectly sensible, but breaks our many text interfaces used and parsed by us and others without expecting the numbers to be formatted. Closes: #825396 (cherry picked from commit b58e2c7c56b1416a343e81f9f80cb1f02c128e25)
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-source.cc4
-rw-r--r--apt-private/private-update.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc
index 5053c60fc..dd52a8822 100644
--- a/apt-private/private-source.cc
+++ b/apt-private/private-source.cc
@@ -478,8 +478,8 @@ bool DoSource(CommandLine &CmdL)
{
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); ++I)
- std::cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
- I->Owner->FileSize << ' ' << I->Owner->HashSum() << std::endl;
+ std::cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
+ std::to_string(I->Owner->FileSize) << ' ' << I->Owner->HashSum() << std::endl;
return true;
}
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index 1e5d69512..ba953a088 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -58,8 +58,8 @@ bool DoUpdate(CommandLine &CmdL)
if(compExt.empty() == false &&
APT::String::Endswith(FileName, compExt))
FileName = FileName.substr(0, FileName.size() - compExt.size() - 1);
- c1out << '\'' << I->URI << "' " << FileName << ' ' <<
- I->Owner->FileSize << ' ' << I->Owner->HashSum() << std::endl;
+ c1out << '\'' << I->URI << "' " << FileName << ' ' <<
+ std::to_string(I->Owner->FileSize) << ' ' << I->Owner->HashSum() << std::endl;
}
return true;
}