Fix FindFile (and FindDir) so that the value of RootDir is applied to the default...
authorDaniel Burrows <Daniel_Burrows@alumni.brown.edu>
Fri, 6 Mar 2009 16:22:53 +0000 (08:22 -0800)
committerDaniel Burrows <Daniel_Burrows@alumni.brown.edu>
Fri, 6 Mar 2009 16:22:53 +0000 (08:22 -0800)
Previously FindFile("Dir::etc", "/etc") would use RootDir if a value
existed for "Dir::etc"; otherwise it would go ahead and use "/etc",
ignoring RootDir.  Of course, this made RootDir fairly useless; it
has now been fixed.

apt-pkg/contrib/configuration.cc

index 7326b84..a82311a 100644 (file)
@@ -182,9 +182,9 @@ string Configuration::FindFile(const char *Name,const char *Default) const
    if (Itm == 0 || Itm->Value.empty() == true)
    {
       if (Default == 0)
-        return "";
+        return rootDir;
       else
-        return Default;
+        return rootDir + Default;
    }
    
    string val = Itm->Value;