Просмотр исходного кода

Fix FindFile (and FindDir) so that the value of RootDir is applied to the default if no value is found.
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.

Daniel Burrows лет назад: 17
Родитель
Сommit
17b3813cfa
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      apt-pkg/contrib/configuration.cc

+ 2 - 2
apt-pkg/contrib/configuration.cc

@@ -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;