Module: wine Branch: master Commit: 4dda7c6371f04d6aaf8c7d37e58139a2acaee567 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4dda7c6371f04d6aaf8c7d37e5...
Author: Lei Zhang thestig@google.com Date: Mon Nov 12 13:30:24 2007 -0800
shell32: Don't crash if $HOME is not set.
---
dlls/shell32/shellpath.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 9e832c1..5be77d7 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -2065,8 +2065,6 @@ static void _SHCreateSymbolicLinks(void) } }
- HeapFree(GetProcessHeap(), 0, pszPersonal); - /* Create symbolic links for 'My Pictures', 'My Video' and 'My Music'. */ for (i=0; i < sizeof(aidsMyStuff)/sizeof(aidsMyStuff[0]); i++) { /* Create the current 'My Whatever' folder and get it's unix path. */ @@ -2094,7 +2092,12 @@ static void _SHCreateSymbolicLinks(void) }
/* 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) && !stat(szDesktopTarget, &statFolder) && S_ISDIR(statFolder.st_mode)) {