]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/aptconfiguration.cc
* apt-pkg/contrib/configuration.cc:
[apt.git] / apt-pkg / aptconfiguration.cc
index 14ee09e0d2ea7c5c34e6d5b6af02f5465a011edc..e1bc94f31302230051edd4986274a9c8d4da78e6 100644 (file)
@@ -8,6 +8,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/error.h>
@@ -53,7 +55,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
        // load the order setting into our vector
        std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
        for (std::vector<std::string>::const_iterator o = order.begin();
-            o != order.end(); o++) {
+            o != order.end(); ++o) {
                if ((*o).empty() == true)
                        continue;
                // ignore types we have no method ready to use
@@ -224,7 +226,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
                environment.push_back("en");
        }
 
-       // Support settings like Acquire::Translation=none on the command line to
+       // Support settings like Acquire::Languages=none on the command line to
        // override the configuration settings vector of languages.
        string const forceLang = _config->Find("Acquire::Languages","");
        if (forceLang.empty() == false) {
@@ -274,7 +276,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
        // then needed and ensure the codes are not listed twice.
        bool noneSeen = false;
        for (std::vector<string>::const_iterator l = lang.begin();
-            l != lang.end(); l++) {
+            l != lang.end(); ++l) {
                if (*l == "environment") {
                        for (std::vector<string>::const_iterator e = environment.begin();
                             e != environment.end(); ++e) {
@@ -337,7 +339,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
                                char* arch = strtok(buf, " ");
                                while (arch != NULL) {
                                        for (; isspace(*arch) != 0; ++arch);
-                                       if (arch != '\0') {
+                                       if (arch[0] != '\0') {
                                                char const* archend = arch;
                                                for (; isspace(*archend) == 0 && *archend != '\0'; ++archend);
                                                archs.push_back(string(arch, (archend - arch)));
@@ -352,7 +354,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
 
        if (archs.empty() == true ||
            std::find(archs.begin(), archs.end(), arch) == archs.end())
-               archs.push_back(arch);
+               archs.insert(archs.begin(), arch);
 
        // erase duplicates and empty strings
        for (std::vector<string>::reverse_iterator a = archs.rbegin();