Ensure installation doesn't fail if directory already exists

This commit is contained in:
Simon Robertshaw 2011-09-27 12:49:11 +01:00
parent 820871e92b
commit d788b15068

View File

@ -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;