]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/dpkgpm.cc
debian/control: Set Standards-Version to 3.9.7
[apt.git] / apt-pkg / deb / dpkgpm.cc
index 6751e9779fd9ab19af3bccdc5a5625bde2328022..1afcb65273419a6ecc3f3cba57ceda14491fed07 100644 (file)
@@ -49,6 +49,7 @@
 #include <utility>
 #include <vector>
 #include <sstream>
 #include <utility>
 #include <vector>
 #include <sstream>
+#include <numeric>
 
 #include <apti18n.h>
                                                                        /*}}}*/
 
 #include <apti18n.h>
                                                                        /*}}}*/
@@ -58,15 +59,13 @@ using namespace std;
 APT_PURE static string
 AptHistoryRequestingUser()
 {
 APT_PURE static string
 AptHistoryRequestingUser()
 {
-   const char* env[]{
-      "SUDO_UID", "PKEXEC_UID", "PACKAGEKIT_CALLER_UID", nullptr
-   };
+   const char* EnvKeys[]{"SUDO_UID", "PKEXEC_UID", "PACKAGEKIT_CALLER_UID"};
 
 
-   for (int i=0; env[i] != nullptr; i++)
+   for (const auto &Key: EnvKeys)
    {
    {
-      if (getenv(env[i]) != nullptr)
+      if (getenv(Key) != nullptr)
       {
       {
-         int uid = atoi(getenv(env[i]));
+         int uid = atoi(getenv(Key));
          if (uid > 0) {
             struct passwd pwd;
             struct passwd *result;
          if (uid > 0) {
             struct passwd pwd;
             struct passwd *result;