X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/74b220028595342028e3309002e4ec359af328f9..c7c71e20d8f1e055ec55c7afeaee52381acfed5b:/methods/mirror.cc diff --git a/methods/mirror.cc b/methods/mirror.cc index 61a7f12fd..d6c5ba955 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -18,7 +18,8 @@ #include #include #include - +#include +#include #include #include @@ -123,9 +124,10 @@ bool MirrorMethod::Clean(string Dir) if (I == list.end()) unlink(Dir->d_name); }; - - chdir(StartDir.c_str()); + closedir(D); + if (chdir(StartDir.c_str()) != 0) + return _error->Errno("chdir",_("Unable to change to %s"),StartDir.c_str()); return true; } @@ -146,9 +148,9 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) // append all architectures std::vector vec = APT::Configuration::getArchitectures(); for (std::vector::const_iterator I = vec.begin(); - I != vec.end(); I++) + I != vec.end(); ++I) if (I == vec.begin()) - fetch += "?arch" + (*I); + fetch += "?arch=" + (*I); else fetch += "&arch=" + (*I);