config/Param: add method GetPath()

Move code from config_parse_path().
This commit is contained in:
Max Kellermann
2016-10-28 11:45:12 +02:00
parent 5b2b4bf13c
commit 7a3415166e
5 changed files with 26 additions and 21 deletions

View File

@@ -128,18 +128,7 @@ config_get_path(ConfigOption option, Error &error)
if (param == nullptr)
return AllocatedPath::Null();
return config_parse_path(param, error);
}
AllocatedPath
config_parse_path(const ConfigParam *param, Error & error)
{
AllocatedPath path = ParsePath(param->value.c_str(), error);
if (gcc_unlikely(path.IsNull()))
error.FormatPrefix("Invalid path at line %i: ",
param->line);
return path;
return param->GetPath(error);
}
unsigned