- use get_current_dir_name for I_GetCWD on POSIX.

This commit is contained in:
Christoph Oelckers 2022-08-17 22:51:39 +02:00
parent e261132db0
commit 7f3c09c918
2 changed files with 10 additions and 6 deletions

View file

@ -173,12 +173,14 @@ unsigned int I_MakeRNGSeed()
FString I_GetCWD()
{
char curdir[PATH_MAX];
if (!getcwd(curdir, countof(curdir)))
char* curdir = get_current_dir_name();
if (!curdir)
{
return "";
}
return curdir;
FString ret(curdir);
free(curdir);
return ret;
}
bool I_ChDir(const char* path)

View file

@ -412,12 +412,14 @@ FString I_GetFromClipboard (bool use_primary_selection)
FString I_GetCWD()
{
char curdir[PATH_MAX];
if (!getcwd(curdir, countof(curdir)))
char* curdir = get_current_dir_name();
if (!curdir)
{
return "";
}
return curdir;
FString ret(curdir);
free(curdir);
return ret;
}
bool I_ChDir(const char* path)