mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Update PhysFS to 3.0.2.
This commit is contained in:
@@ -572,18 +572,20 @@ char *__PHYSFS_platformCalcUserDir(void)
|
||||
/*
|
||||
* Should fail. Will write the size of the profile path in
|
||||
* psize. Also note that the second parameter can't be
|
||||
* NULL or the function fails.
|
||||
*/
|
||||
/*
|
||||
* EDIT: (03.10.2018) after Windows 10 Update 1809 psize will be zero
|
||||
* if something other than NULL is passed for the second argument.
|
||||
* Passing NULL now makes GetUserProfileDirectoryW fail (rc == 0)
|
||||
* and psize receives the correct user directory length.
|
||||
* It seems to work fine on Windows 7 and Windows 10 Update 1803 too
|
||||
* NULL or the function fails on Windows XP, but has to be NULL on
|
||||
* Windows 10 or it will fail. :(
|
||||
*/
|
||||
rc = pGetDir(accessToken, NULL, &psize);
|
||||
GOTO_IF(rc, PHYSFS_ERR_OS_ERROR, done); /* should have failed! */
|
||||
|
||||
if (psize == 0) /* probably on Windows XP, try a different way. */
|
||||
{
|
||||
WCHAR x = 0;
|
||||
rc = pGetDir(accessToken, &x, &psize);
|
||||
GOTO_IF(rc, PHYSFS_ERR_OS_ERROR, done); /* should have failed! */
|
||||
GOTO_IF(!psize, PHYSFS_ERR_OS_ERROR, done); /* Uhoh... */
|
||||
} /* if */
|
||||
|
||||
/* Allocate memory for the profile directory */
|
||||
wstr = (LPWSTR) __PHYSFS_smallAlloc((psize + 1) * sizeof (WCHAR));
|
||||
if (wstr != NULL)
|
||||
|
||||
Reference in New Issue
Block a user