Skip to content

Commit

Permalink
+ if getcwd fails then use '.'
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 11, 2016
1 parent f3a5dee commit d7d347b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Base/FileInfo.cpp
Expand Up @@ -233,14 +233,13 @@ std::string FileInfo::dirPath () const
}
else {
#ifdef FC_OS_WIN32
wchar_t buf[MAX_PATH];
wchar_t buf[MAX_PATH+1];
GetCurrentDirectoryW(MAX_PATH, buf);
retval = std::string(ConvertFromWideString(std::wstring(buf)));
#else
char buf[PATH_MAX+1];
const char* cwd = getcwd(buf, PATH_MAX);
if (cwd)
retval = std::string(cwd);
retval = std::string(cwd ? cwd : ".");
#endif
}
return retval;
Expand Down

0 comments on commit d7d347b

Please sign in to comment.