X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8a27f5da85830fe500077891c5db1c77ae1773a6..549da1a850f0fd50e0a55415452ecaa735d49451:/apt-pkg/contrib/configuration.cc?ds=sidebyside diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 6f617e914..7326b84ea 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -635,26 +635,21 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool AsSectional, for (std::string::const_iterator I = Start; I != End; ++I) { - if(Start > End) - { - _error->Error("Why is Start > End?"); - } - if (*I == '"') InQuote = !InQuote; if (InQuote == false && (*I == '{' || *I == ';' || *I == '}')) { // Put the last fragment into the buffer - std::string::const_iterator FirstNonWhitespace = Start; - std::string::const_iterator LastNonWhitespace = I; - for (; FirstNonWhitespace != I && isspace(*FirstNonWhitespace) != 0; FirstNonWhitespace++) + std::string::const_iterator NonWhitespaceStart = Start; + std::string::const_iterator NonWhitespaceStop = I; + for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; NonWhitespaceStart++) ; - for (; LastNonWhitespace != FirstNonWhitespace && isspace(LastNonWhitespace[-1]) != 0; LastNonWhitespace--) + for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; NonWhitespaceStop--) ; - if (LineBuffer.empty() == false && LastNonWhitespace - FirstNonWhitespace != 0) + if (LineBuffer.empty() == false && NonWhitespaceStop - NonWhitespaceStart != 0) LineBuffer += ' '; - LineBuffer += string(FirstNonWhitespace, LastNonWhitespace); + LineBuffer += string(NonWhitespaceStart, NonWhitespaceStop); // Drop this from the input string, saving the character // that terminated the construct we just closed. (i.e., a