* Expander now searches its rules file in the data directory, no longer in /etc.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33949 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-11-08 13:57:04 +00:00
parent b6c92a3779
commit 2b1296e8c4
+13 -11
View File
@@ -102,20 +102,22 @@ ExpanderRules::~ExpanderRules()
status_t
ExpanderRules::Open(BFile *file)
{
BPath path;
if (find_directory(B_USER_CONFIG_DIRECTORY, &path) != B_OK)
return B_ERROR;
directory_which which[] = {
B_USER_DATA_DIRECTORY,
B_COMMON_DATA_DIRECTORY
};
path.Append("etc/expander.rules");
if (file->SetTo(path.Path(), B_READ_ONLY) == B_OK)
return B_OK;
for (size_t i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
BPath path;
if (find_directory(which[i], &path) != B_OK)
continue;
if (find_directory(B_COMMON_ETC_DIRECTORY, &path) != B_OK)
return B_ERROR;
path.Append("expander.rules");
if (file->SetTo(path.Path(), B_READ_ONLY) == B_OK)
return B_OK;
}
path.Append("expander.rules");
return file->SetTo(path.Path(), B_READ_ONLY);
return B_ENTRY_NOT_FOUND;
}