1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 23:56:39 +02:00

Allow using absolute paths in more places.

This commit is contained in:
Sadie Powell
2024-03-19 15:10:25 +00:00
parent 1575dea5b9
commit fde3438ef2
13 changed files with 69 additions and 27 deletions
+2 -2
View File
@@ -697,7 +697,7 @@ const Anope::string &File::GetName() const
Anope::string File::GetPath() const
{
return (this->executable ? "" : Anope::ConfigDir + "/") + this->name;
return this->executable ? this->name : Anope::ExpandConfig(this->name);
}
bool File::IsOpen() const
@@ -708,7 +708,7 @@ bool File::IsOpen() const
bool File::Open()
{
this->Close();
this->fp = (this->executable ? popen(this->name.c_str(), "r") : fopen((Anope::ConfigDir + "/" + this->name).c_str(), "r"));
this->fp = (this->executable ? popen(GetPath().c_str(), "r") : fopen(GetPath().c_str(), "r"));
return this->fp != NULL;
}