Use path::is_absolute instead of own logic

This commit is contained in:
Allan Odgaard
2012-08-13 22:54:09 +02:00
parent 4259a8f884
commit 718ea40002

View File

@@ -57,7 +57,7 @@ namespace
static std::vector<std::string> paths (std::string const& directory)
{
std::vector<std::string> res;
for(std::string cwd = (directory.empty() || directory[0] != '/' ? path::home() : directory); true; cwd = cwd == "/" ? path::home() : path::parent(cwd))
for(std::string cwd = path::is_absolute(directory) ? directory : path::home(); true; cwd = cwd == "/" ? path::home() : path::parent(cwd))
{
res.push_back(path::join(cwd, ".tm_properties"));
if(cwd == path::home())