Author: hpoussin Date: Sun Aug 6 22:44:27 2006 New Revision: 23505
URL: http://svn.reactos.org/svn/reactos?rev=23505&view=rev Log: Fix an infinite loop if environment variable is not defined
Modified: trunk/reactos/dll/win32/shell32/shellpath.c
Modified: trunk/reactos/dll/win32/shell32/shellpath.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shellpath... ============================================================================== --- trunk/reactos/dll/win32/shell32/shellpath.c (original) +++ trunk/reactos/dll/win32/shell32/shellpath.c Sun Aug 6 22:44:27 2006 @@ -1548,12 +1548,12 @@ hr = HRESULT_FROM_WIN32(GetLastError()); else hr = S_OK; - if (SUCCEEDED(hr) && szDest[0] == '%') + /* By default, terminate loop */ + szTemp[0] = '\0'; + if (SUCCEEDED(hr) && strcmpW(szSrc, szDest) != 0) + { + /* Continue the loop */ strcpyW(szTemp, szDest); - else - { - /* terminate loop */ - szTemp[0] = '\0'; } } end: