mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 20:12:50 +02:00
Ensure installation doesn't fail if directory already exists
This commit is contained in:
20
src/misc.c
20
src/misc.c
@@ -504,25 +504,9 @@ int register_extension()
|
|||||||
if((strlen(AppDataPath)+strlen(APPDATA_SUBDIR "\\Powder Toy"))<MAX_PATH)
|
if((strlen(AppDataPath)+strlen(APPDATA_SUBDIR "\\Powder Toy"))<MAX_PATH)
|
||||||
{
|
{
|
||||||
strappend(AppDataPath, APPDATA_SUBDIR);
|
strappend(AppDataPath, APPDATA_SUBDIR);
|
||||||
#ifdef WIN32
|
_mkdir(AppDataPath);
|
||||||
if(_mkdir(AppDataPath))
|
|
||||||
#else
|
|
||||||
if(mkdir(AppDataPath, 0755))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
returnval = 0;
|
|
||||||
goto finalise;
|
|
||||||
}
|
|
||||||
strappend(AppDataPath, "\\Powder Toy");
|
strappend(AppDataPath, "\\Powder Toy");
|
||||||
#ifdef WIN32
|
_mkdir(AppDataPath);
|
||||||
if(_mkdir(AppDataPath))
|
|
||||||
#else
|
|
||||||
if(mkdir(AppDataPath, 0755))
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
returnval = 0;
|
|
||||||
goto finalise;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
returnval = 0;
|
returnval = 0;
|
||||||
goto finalise;
|
goto finalise;
|
||||||
|
Reference in New Issue
Block a user