Skip to content
Snippets Groups Projects
Commit 1ef6ff50 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

BUG: Prevent crash when the current working directory cannot be established

parent 1d3349b7
No related branches found
No related tags found
No related merge requests found
......@@ -1281,7 +1281,12 @@ int SystemTools::ChangeDirectory(const char *dir)
kwsys_stl::string SystemTools::GetCurrentWorkingDirectory()
{
char buf[2048];
kwsys_stl::string path = Getcwd(buf, 2048);
const char* cwd = Getcwd(buf, 2048);
kwsys_stl::string path;
if ( cwd )
{
path = cwd;
}
return path;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment