]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
* apt-pkg/depcache.cc:
[apt.git] / apt-pkg / cdrom.cc
index 271bca409884596efb18b71e433b750c0f9bee2e..0e36f44a27a0f7c9912808f213e8550c4484f7b0 100644 (file)
@@ -229,7 +229,7 @@ bool pkgCdrom::DropBinaryArch(vector<string> &List)
       // Between Start and End is the architecture
       Start += 8;
       if ((End = strstr(Start,"/")) != 0 && Start != End &&
-          APT::Configuration::checkArchitecture(string(Start, --End)) == true)
+          APT::Configuration::checkArchitecture(string(Start, End)) == true)
         continue; // okay, architecture is accepted
 
       // not accepted -> Erase it
@@ -281,7 +281,8 @@ bool pkgCdrom::DropRepeats(vector<string> &List,const char *Name)
         List[J] = string();
       }
    }  
+   delete[] Inodes;
+
    // Wipe erased entries
    for (unsigned int I = 0; I < List.size();)
    {
@@ -382,7 +383,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
 
    Out.close();
    
-   rename(DFile.c_str(),string(DFile + '~').c_str());
+   link(DFile.c_str(),string(DFile + '~').c_str());
    if (rename(NewFile.c_str(),DFile.c_str()) != 0)
       return _error->Errno("rename","Failed to rename %s.new to %s",
                           DFile.c_str(),DFile.c_str());
@@ -821,8 +822,6 @@ bool pkgCdrom::Add(pkgCdromStatus *log)                                     /*{{{*/
       }
    }
 
-   
-
    // Unmount and finish
    if (_config->FindB("APT::CDROM::NoMount",false) == false) {
       log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
@@ -913,6 +912,7 @@ pkgUdevCdromDevices::Scan()                                             /*{{{*/
 
 pkgUdevCdromDevices::~pkgUdevCdromDevices()                             /*{{{*/
 { 
-   dlclose(libudev_handle);
+   if (libudev_handle != NULL)
+      dlclose(libudev_handle);
 }
                                                                        /*}}}*/