mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- use get_current_dir_name for I_GetCWD on POSIX.
This commit is contained in:
parent
e261132db0
commit
7f3c09c918
2 changed files with 10 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue