]> git.saurik.com Git - apt.git/commitdiff
prevent C++ locale number formatting in text APIs (try 2)
authorDavid Kalnischkies <david@kalnischkies.de>
Sat, 30 Jul 2016 07:57:50 +0000 (09:57 +0200)
committerJulian Andres Klode <jak@debian.org>
Mon, 14 Nov 2016 14:10:03 +0000 (15:10 +0100)
Followup of b58e2c7c56b1416a343e81f9f80cb1f02c128e25.
Still a regression of sorts of 8b79c94af7f7cf2e5e5342294bc6e5a908cacabf.

Closes: 832044
(cherry picked from commit 7303e11ff28f920a6277c159aa46f80c007350bb)

apt-pkg/acquire-item.cc
apt-private/acqprogress.cc
methods/http.cc

index fd02b6bba8b289d7ff42432a08e8d300728f1a67..d8921be072ad6d85d38f486804297e181ede5351 100644 (file)
@@ -2596,7 +2596,7 @@ std::string pkgAcqIndexMergeDiffs::Custom600Headers() const               /*{{{*/
    {
       HashStringList const ExpectedHashes = (*I)->patch.patch_hashes;
       for (HashStringList::const_iterator hs = ExpectedHashes.begin(); hs != ExpectedHashes.end(); ++hs)
-        patchhashes <<  "\nPatch-" << seen_patches << "-" << hs->HashType() << "-Hash: " << hs->HashValue();
+        patchhashes <<  "\nPatch-" << std::to_string(seen_patches) << "-" << hs->HashType() << "-Hash: " << hs->HashValue();
       ++seen_patches;
    }
    patchhashes << pkgAcqBaseIndex::Custom600Headers();
index a33d51c7178d60d631586c03f768d2c46ed74dcf..4e6042c3d25455c9e1378f70cf8524eac02b36cb 100644 (file)
@@ -194,7 +194,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
         // Add in the short description
         S << " [";
         if (I->CurrentItem->Owner->ID != 0)
-           S << I->CurrentItem->Owner->ID << " ";
+           S << std::to_string(I->CurrentItem->Owner->ID) << " ";
         S << I->CurrentItem->ShortDesc;
 
         // Show the short mode string
@@ -204,7 +204,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
         enum {Long = 0,Medium,Short} Mode = Medium;
         // Add the current progress
         if (Mode == Long)
-           S << " " << I->CurrentSize;
+           S << " " << std::to_string(I->CurrentSize);
         else
         {
            if (Mode == Medium || I->TotalSize == 0)
index 46d90e2566608d3f71b59fec61a15d85b47d65df..96b24a1465429ebf1cca6e7233aef9adbdeaa935 100644 (file)
@@ -739,7 +739,7 @@ void HttpMethod::SendReq(FetchItem *Itm)
    // Check for a partial file and send if-queries accordingly
    struct stat SBuf;
    if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
-      Req << "Range: bytes=" << SBuf.st_size << "-\r\n"
+      Req << "Range: bytes=" << std::to_string(SBuf.st_size) << "-\r\n"
         << "If-Range: " << TimeRFC1123(SBuf.st_mtime) << "\r\n";
    else if (Itm->LastModified != 0)
       Req << "If-Modified-Since: " << TimeRFC1123(Itm->LastModified).c_str() << "\r\n";