X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ea50fdfe2fc21757412baf448b2d41b3ce34b626..709038652854b71895e06caed2b028b389acefd6:/apt-pkg/sourcelist.cc diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index a25358bf2..0fd237cad 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -8,15 +8,19 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include - -#include +#include +#include #include + +#include /*}}}*/ using namespace std; @@ -29,7 +33,7 @@ unsigned long pkgSourceList::Type::GlobalListLen = 0; // Type::Type - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Link this to the global list of items*/ -pkgSourceList::Type::Type() +pkgSourceList::Type::Type() : Name(NULL), Label(NULL) { ItmList[GlobalListLen] = this; GlobalListLen++; @@ -266,7 +270,11 @@ bool pkgSourceList::ReadAppend(string File) // CNC:2003-02-20 - Do not break if '#' is inside []. for (I = Buffer; *I != 0 && *I != '#'; I++) if (*I == '[') - for (I++; *I != 0 && *I != ']'; I++); + { + char *b_end = strchr(I + 1, ']'); + if (b_end != NULL) + I = b_end; + } *I = 0; const char *C = _strstrip(Buffer); @@ -346,10 +354,14 @@ bool pkgSourceList::ReadSourceDir(string Dir) /* */ time_t pkgSourceList::GetLastModifiedTime() { - // go over the parts + vector List; + string Main = _config->FindFile("Dir::Etc::sourcelist"); string Parts = _config->FindDir("Dir::Etc::sourceparts"); - vector const List = GetListOfFilesInDir(Parts, "list", true); + + // go over the parts + if (DirectoryExists(Parts) == true) + List = GetListOfFilesInDir(Parts, "list", true); // calculate the time time_t mtime_sources = GetModificationTime(Main);