From 1e3bc51e7158c3b3b80aaa765cdaff0ed879c613 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 24 Aug 2008 16:43:08 +0000 Subject: [PATCH] - Check if source and destination is the same. Fixes creating a new directory and using the default name svn path=/trunk/; revision=35603 --- reactos/dll/win32/shell32/shfldr_fs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/dll/win32/shell32/shfldr_fs.c b/reactos/dll/win32/shell32/shfldr_fs.c index cc94009bc02..a67907ed4e1 100644 --- a/reactos/dll/win32/shell32/shfldr_fs.c +++ b/reactos/dll/win32/shell32/shfldr_fs.c @@ -886,6 +886,16 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface, } TRACE ("src=%s dest=%s\n", debugstr_w(szSrc), debugstr_w(szDest)); + if (!memcmp(szSrc, szDest, (wcslen(szDest)+1) * sizeof(WCHAR))) + { + /* src and destination is the same */ + HRESULT hr = S_OK; + if (pPidlOut) + hr = _ILCreateFromPathW(szDest, pPidlOut); + + return hr; + } + if (MoveFileW (szSrc, szDest)) { HRESULT hr = S_OK;