diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2012-02-10 15:01:31 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2012-02-10 15:01:31 +0100 |
commit | dd7233af3e0287566af3946da4b06afd6ccca73a (patch) | |
tree | c80b6261d85de2c62b0da56cf12da5eb3001e246 /apt-pkg | |
parent | 17019a09e703452735d5af2538654e0532d27d51 (diff) | |
download | apt-dd7233af3e0287566af3946da4b06afd6ccca73a.tar.gz |
ensure that architectures are not added multiple times
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index 721b6fd63..4324f0e63 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -392,7 +392,9 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache if (arch[0] != '\0') { char const* archend = arch; for (; isspace(*archend) == 0 && *archend != '\0'; ++archend); - archs.push_back(string(arch, (archend - arch))); + string a(arch, (archend - arch)); + if (std::find(archs.begin(), archs.end(), a) == archs.end()) + archs.push_back(a); } arch = strtok(NULL, " "); } |