Fixed directory creation checks.

This commit is contained in:
Armin Novak 2015-06-02 10:00:43 +02:00
parent dd1a03191d
commit d3a88014da
2 changed files with 7 additions and 1 deletions

View File

@ -474,9 +474,12 @@ rdpSettings* freerdp_settings_new(DWORD flags)
goto out_fail;
base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME,
FREERDP_VENDOR_STRING);
if (base && CreateDirectoryA(base, NULL))
if (base)
{
settings->ConfigPath = GetCombinedPath(base, FREERDP_PRODUCT_STRING);
if (!PathFileExistsA(base))
if (!CreateDirectoryA(base, NULL))
settings->ConfigPath = NULL;
}
free (base);

View File

@ -203,6 +203,9 @@ static char* GetPath_XDG_CACHE_HOME(void)
home = GetPath_XDG_RUNTIME_DIR();
path = GetCombinedPath(home, "cache");
if (!PathFileExistsA(path))
if (!CreateDirectoryA(path, NULL))
path = NULL;
free(home);
#else
/**