mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 13:51:52 +00:00
- get_current_dir_name apparently does not exist on macOS
This commit is contained in:
parent
7f3c09c918
commit
532a493752
1 changed files with 14 additions and 18 deletions
|
@ -173,14 +173,12 @@ unsigned int I_MakeRNGSeed()
|
|||
|
||||
FString I_GetCWD()
|
||||
{
|
||||
char* curdir = get_current_dir_name();
|
||||
if (!curdir)
|
||||
char curdir[PATH_MAX];
|
||||
if (!getcwd(curdir, countof(curdir)))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
FString ret(curdir);
|
||||
free(curdir);
|
||||
return ret;
|
||||
return curdir;
|
||||
}
|
||||
|
||||
bool I_ChDir(const char* path)
|
||||
|
@ -188,20 +186,18 @@ bool I_ChDir(const char* path)
|
|||
return chdir(path) == 0;
|
||||
}
|
||||
|
||||
void I_OpenShellFolder(const char* infolder)
|
||||
void I_OpenShellFolder(const char* folder)
|
||||
{
|
||||
char* curdir = get_current_dir_name();
|
||||
char curdir[PATH_MAX];
|
||||
if (!getcwd (curdir, countof(curdir)))
|
||||
{
|
||||
Printf ("Current path too long\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chdir(infolder))
|
||||
{
|
||||
Printf("Opening folder: %s\n", infolder);
|
||||
system("open .");
|
||||
chdir(folder);
|
||||
Printf("Opening folder: %s\n", folder);
|
||||
std::system("open .");
|
||||
chdir(curdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("Unable to open directory '%s\n", infolder);
|
||||
}
|
||||
free(curdir);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue