Commit ab198a22 authored by Brad King's avatar Brad King
Browse files

SystemTools: Return Status from GetShortPath

parent 06216f0b
......@@ -3971,7 +3971,8 @@ bool SystemToolsStatic::FileIsFullPath(const char* in_name, size_t len)
return false;
}
bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath)
Status SystemTools::GetShortPath(std::string const& path,
std::string& shortPath)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
std::string tempPath = path; // create a buffer
......@@ -3991,14 +3992,14 @@ bool SystemTools::GetShortPath(const std::string& path, std::string& shortPath)
}
if (ret == 0) {
return false;
return Status::Windows_GetLastError();
} else {
shortPath = Encoding::ToNarrow(&buffer[0]);
return true;
return Status::Success();
}
#else
shortPath = path;
return true;
return Status::Success();
#endif
}
......
......@@ -508,7 +508,7 @@ public:
* For windows return the short path for the given path,
* Unix just a pass through
*/
static bool GetShortPath(const std::string& path, std::string& result);
static Status GetShortPath(std::string const& path, std::string& result);
/**
* Read line from file. Make sure to read a full line and truncates it if
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment