https://git.reactos.org/?p=reactos.git;a=commitdiff;h=957d07436bd0e4e36743c63797b52237a8fec702
commit 957d07436bd0e4e36743c63797b52237a8fec702 Author: Katayama Hirofumi MZ <[email protected]> AuthorDate: Tue Oct 6 17:44:20 2020 +0900 Commit: GitHub <[email protected]> CommitDate: Tue Oct 6 17:44:20 2020 +0900 [BROWSEUI] Remove '\1' from AutoComplete list (#3264) Delete "backslash one" (indicates SW_ values) from auto-completion list. CORE-9281 --- dll/win32/browseui/ACLCustomMRU.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dll/win32/browseui/ACLCustomMRU.cpp b/dll/win32/browseui/ACLCustomMRU.cpp index 83c8dfc55db..c1081cbf7d4 100644 --- a/dll/win32/browseui/ACLCustomMRU.cpp +++ b/dll/win32/browseui/ACLCustomMRU.cpp @@ -33,12 +33,22 @@ STDMETHODIMP CACLCustomMRU::Next(ULONG celt, LPWSTR *rgelt, ULONG *pceltFetched) if (INT(m_ielt) >= m_MRUData.GetSize()) return S_FALSE; - size_t cb = (m_MRUData[m_ielt].GetLength() + 1) * sizeof(WCHAR); + CStringW str = m_MRUData[m_ielt]; + + if (!m_bTypedURLs) + { + // Erase the last "\\1" etc. (indicates SW_* value) + INT ich = str.ReverseFind(L'\\'); + if (ich >= 0) + str = str.Left(ich); + } + + size_t cb = (str.GetLength() + 1) * sizeof(WCHAR); LPWSTR psz = (LPWSTR)CoTaskMemAlloc(cb); if (!psz) return S_FALSE; - CopyMemory(psz, (LPCWSTR)m_MRUData[m_ielt], cb); + CopyMemory(psz, (LPCWSTR)str, cb); *rgelt = psz; *pceltFetched = 1; ++m_ielt;
