From 9c08c46e1fd3162b3990a79ce732beaf66bc447b Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 25 Jun 2007 14:02:29 +0200 Subject: [PATCH] advpack: Get rid of CharPrevW. --- dlls/advpack/files.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dlls/advpack/files.c b/dlls/advpack/files.c index 134ed1c5d70..163f994cdf1 100644 --- a/dlls/advpack/files.c +++ b/dlls/advpack/files.c @@ -331,7 +331,6 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) DWORD fattrs = GetFileAttributesW(fname); HRESULT ret = E_FAIL; - static const WCHAR backslash[] = {'\\',0}; static const WCHAR asterisk[] = {'*',0}; static const WCHAR dot[] = {'.',0}; static const WCHAR dotdot[] = {'.','.',0}; @@ -344,11 +343,7 @@ static HRESULT DELNODE_recurse_dirtree(LPWSTR fname, DWORD flags) int fname_len = lstrlenW(fname); /* Generate a path with wildcard suitable for iterating */ - if (lstrcmpW(CharPrevW(fname, fname + fname_len), backslash)) - { - lstrcpyW(fname + fname_len, backslash); - ++fname_len; - } + if (fname_len && fname[fname_len-1] != '\\') fname[fname_len++] = '\\'; lstrcpyW(fname + fname_len, asterisk); if ((hFindFile = FindFirstFileW(fname, &w32fd)) != INVALID_HANDLE_VALUE) -- 2.11.4.GIT