From afb2063fd33ec99cb56ad0f0edf4b071f4ea777a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 6 Aug 2006 18:44:27 +0000 Subject: [PATCH] Fix an infinite loop if environment variable is not defined svn path=/trunk/; revision=23505 --- reactos/dll/win32/shell32/shellpath.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/shell32/shellpath.c b/reactos/dll/win32/shell32/shellpath.c index dd2d66850f5..31a465068b2 100644 --- a/reactos/dll/win32/shell32/shellpath.c +++ b/reactos/dll/win32/shell32/shellpath.c @@ -1548,12 +1548,12 @@ static HRESULT _SHExpandEnvironmentStrings(LPCWSTR szSrc, LPWSTR szDest) hr = HRESULT_FROM_WIN32(GetLastError()); else hr = S_OK; - if (SUCCEEDED(hr) && szDest[0] == '%') - strcpyW(szTemp, szDest); - else + /* By default, terminate loop */ + szTemp[0] = '\0'; + if (SUCCEEDED(hr) && strcmpW(szSrc, szDest) != 0) { - /* terminate loop */ - szTemp[0] = '\0'; + /* Continue the loop */ + strcpyW(szTemp, szDest); } } end: