fs/AllocatedPath: make the nullptr_t constructor public
This commit is contained in:
@@ -118,7 +118,7 @@ ConfigBlock::GetPath(const char *name, const char *default_value) const
|
||||
s = bp->value.c_str();
|
||||
} else {
|
||||
if (default_value == nullptr)
|
||||
return AllocatedPath::Null();
|
||||
return nullptr;
|
||||
|
||||
s = default_value;
|
||||
}
|
||||
|
@@ -125,7 +125,7 @@ config_get_path(ConfigOption option)
|
||||
{
|
||||
const auto *param = config_get_param(option);
|
||||
if (param == nullptr)
|
||||
return AllocatedPath::Null();
|
||||
return nullptr;
|
||||
|
||||
return param->GetPath();
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ config_get_string(enum ConfigOption option,
|
||||
/**
|
||||
* Returns an optional configuration variable which contains an
|
||||
* absolute path. If there is a tilde prefix, it is expanded.
|
||||
* Returns AllocatedPath::Null() if the value is not present.
|
||||
* Returns nullptr if the value is not present.
|
||||
*
|
||||
* Throws #std::runtime_error on error.
|
||||
*/
|
||||
|
@@ -86,7 +86,7 @@ ParsePath(const char *path)
|
||||
if (*path == '\0')
|
||||
return GetConfiguredHome();
|
||||
|
||||
AllocatedPath home = AllocatedPath::Null();
|
||||
AllocatedPath home = nullptr;
|
||||
|
||||
if (*path == '/') {
|
||||
home = GetConfiguredHome();
|
||||
@@ -107,11 +107,11 @@ ParsePath(const char *path)
|
||||
}
|
||||
|
||||
if (home.IsNull())
|
||||
return AllocatedPath::Null();
|
||||
return nullptr;
|
||||
|
||||
AllocatedPath path2 = AllocatedPath::FromUTF8Throw(path);
|
||||
if (path2.IsNull())
|
||||
return AllocatedPath::Null();
|
||||
return nullptr;
|
||||
|
||||
return AllocatedPath::Build(home, path2);
|
||||
} else if (!PathTraitsUTF8::IsAbsolute(path)) {
|
||||
|
Reference in New Issue
Block a user