mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +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';
|
*p = '\0';
|
||||||
}
|
}
|
||||||
struct stat info;
|
if (!DirEntryExists(copy) && mkdir(copy, 0755) == -1)
|
||||||
if (DirEntryExists(copy))
|
|
||||||
{
|
{
|
||||||
if (info.st_mode & S_IFDIR)
|
// failed
|
||||||
goto exists;
|
|
||||||
}
|
|
||||||
if (mkdir(copy, 0755) == -1)
|
|
||||||
{ // failed
|
|
||||||
free(copy);
|
free(copy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
exists: if (p != NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
*p = '/';
|
*p = '/';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue