diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-23 17:26:43 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2009-09-23 17:26:43 +0200 |
commit | f98233c1b1e93ef1bb595bfc6e59c74d9e05eb6a (patch) | |
tree | 82d6aa3ff7c2c2e6d073ff39f09e52aa7407562d /apt-pkg/contrib/configuration.cc | |
parent | a69a3a044be84f72508fb468cdf13d9e5f724dd4 (diff) | |
parent | f7d6459db697c6dbba8e5d787a817e7721bfb577 (diff) |
merged from debian
Diffstat (limited to 'apt-pkg/contrib/configuration.cc')
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 48a5f0bff..4e8586e83 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -223,6 +223,25 @@ string Configuration::FindDir(const char *Name,const char *Default) const return Res; } /*}}}*/ +// Configuration::FindVector - Find a vector of values /*{{{*/ +// --------------------------------------------------------------------- +/* Returns a vector of config values under the given item */ +vector<string> Configuration::FindVector(const char *Name) const +{ + vector<string> Vec; + const Item *Top = Lookup(Name); + if (Top == NULL) + return Vec; + + Item *I = Top->Child; + while(I != NULL) + { + Vec.push_back(I->Value); + I = I->Next; + } + return Vec; +} + /*}}}*/ // Configuration::FindI - Find an integer value /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -582,9 +601,11 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool AsSectional, InQuote = !InQuote; if (InQuote == true) continue; - - if ((*I == '/' && I + 1 != End && I[1] == '/') || *I == '#') - { + + if ((*I == '/' && I + 1 != End && I[1] == '/') || + (*I == '#' && strcmp(string(I,I+6).c_str(),"#clear") != 0 && + strcmp(string(I,I+8).c_str(),"#include") != 0)) + { End = I; break; } |