Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

winws2: create writeable zapret2 dir in LocalLow and set WRITEABLE env

This commit is contained in:
bol-van
2025-11-24 17:33:11 +03:00
parent e963b6f20b
commit ef421bad9c

View File

@@ -672,13 +672,16 @@ static bool set_low_appdata_env()
if (SUCCEEDED(hr))
{
size_t l = cygwin_conv_path(CCP_WIN_W_TO_POSIX | CCP_ABSOLUTE, pszPath, NULL, 0);
char *buf = (char*)malloc(l);
char *buf = (char*)malloc(l+8);
if (buf)
{
if (!cygwin_conv_path(CCP_WIN_W_TO_POSIX | CCP_ABSOLUTE, pszPath, buf, l))
{
b = true;
setenv("APPDATALOW", buf, 1);
memcpy(buf+l-1,"/zapret2",9);
setenv("WRITEABLE", buf, 1);
mkdir(buf,0755);
}
free(buf);
}