mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Fixed Filesystem::getWorkingDirectory() so that it actually compiles on non-Windows systems.
This commit is contained in:
@@ -163,13 +163,13 @@ namespace physfs
|
|||||||
cwd = to_utf8(w_cwd);
|
cwd = to_utf8(w_cwd);
|
||||||
replace_char(cwd, '\\', '/');
|
replace_char(cwd, '\\', '/');
|
||||||
#else
|
#else
|
||||||
cwd = new char[LOVE_MAX_PATH];
|
char * cwd_char = new char[LOVE_MAX_PATH];
|
||||||
|
|
||||||
if(!getcwd(cwd, LOVE_MAX_PATH))
|
getcwd(cwd_char, LOVE_MAX_PATH);
|
||||||
{
|
|
||||||
delete [] cwd;
|
cwd = cwd_char; // if getcwd fails, cwd_char (and thus cwd) will still be empty
|
||||||
cwd = 0;
|
|
||||||
}
|
delete [] cwd_char;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ namespace physfs
|
|||||||
replace_char(appdata, '\\', '/');
|
replace_char(appdata, '\\', '/');
|
||||||
}
|
}
|
||||||
return appdata.c_str();
|
return appdata.c_str();
|
||||||
#elif defined(LOVE_MACOSX
|
#elif defined(LOVE_MACOSX)
|
||||||
if(appdata.empty())
|
if(appdata.empty())
|
||||||
{
|
{
|
||||||
std::string udir = getUserDirectory();
|
std::string udir = getUserDirectory();
|
||||||
|
|||||||
Reference in New Issue
Block a user