Ensure installation doesn't fail if directory already exists
This commit is contained in:
parent
820871e92b
commit
d788b15068
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)
|
||||
{
|
||||
strappend(AppDataPath, APPDATA_SUBDIR);
|
||||
#ifdef WIN32
|
||||
if(_mkdir(AppDataPath))
|
||||
#else
|
||||
if(mkdir(AppDataPath, 0755))
|
||||
#endif
|
||||
{
|
||||
returnval = 0;
|
||||
goto finalise;
|
||||
}
|
||||
_mkdir(AppDataPath);
|
||||
strappend(AppDataPath, "\\Powder Toy");
|
||||
#ifdef WIN32
|
||||
if(_mkdir(AppDataPath))
|
||||
#else
|
||||
if(mkdir(AppDataPath, 0755))
|
||||
#endif
|
||||
{
|
||||
returnval = 0;
|
||||
goto finalise;
|
||||
}
|
||||
_mkdir(AppDataPath);
|
||||
} else {
|
||||
returnval = 0;
|
||||
goto finalise;
|
||||
|
Loading…
Reference in New Issue
Block a user