Commit 4dda7c63 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

shell32: Don't crash if $HOME is not set.

parent 70c75dcd
...@@ -2065,8 +2065,6 @@ static void _SHCreateSymbolicLinks(void) ...@@ -2065,8 +2065,6 @@ static void _SHCreateSymbolicLinks(void)
} }
} }
HeapFree(GetProcessHeap(), 0, pszPersonal);
/* Create symbolic links for 'My Pictures', 'My Video' and 'My Music'. */ /* Create symbolic links for 'My Pictures', 'My Video' and 'My Music'. */
for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) { for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) {
/* Create the current 'My Whatever' folder and get it's unix path. */ /* Create the current 'My Whatever' folder and get it's unix path. */
...@@ -2094,7 +2092,12 @@ static void _SHCreateSymbolicLinks(void) ...@@ -2094,7 +2092,12 @@ static void _SHCreateSymbolicLinks(void)
} }
/* Last but not least, the Desktop folder */ /* Last but not least, the Desktop folder */
strcpy(szDesktopTarget, pszHome); if (pszHome)
strcpy(szDesktopTarget, pszHome);
else
strcpy(szDesktopTarget, pszPersonal);
HeapFree(GetProcessHeap(), 0, pszPersonal);
if (_SHAppendToUnixPath(szDesktopTarget, DesktopW) && if (_SHAppendToUnixPath(szDesktopTarget, DesktopW) &&
!stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) !stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment