mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
Fixed directory creation for POSIX targets
Warning was reported by GCC 7 only: cmdlib.cpp:550:13: warning: ‘info.stat::st_mode’ may be used uninitialized in this function [-Wmaybe-uninitialized]
This commit is contained in:
parent
5f50d60eff
commit
31b0fdc9fe
1 changed files with 3 additions and 8 deletions
|
@ -544,18 +544,13 @@ void CreatePath(const char *fn)
|
|||
{
|
||||
*p = '\0';
|
||||
}
|
||||
struct stat info;
|
||||
if (DirEntryExists(copy))
|
||||
if (!DirEntryExists(copy) && mkdir(copy, 0755) == -1)
|
||||
{
|
||||
if (info.st_mode & S_IFDIR)
|
||||
goto exists;
|
||||
}
|
||||
if (mkdir(copy, 0755) == -1)
|
||||
{ // failed
|
||||
// failed
|
||||
free(copy);
|
||||
return;
|
||||
}
|
||||
exists: if (p != NULL)
|
||||
if (p != NULL)
|
||||
{
|
||||
*p = '/';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue