[SHELL32] CRecycleBin: Add backshash if path is drive only (#7170)

JIRA issue: CORE-18006
If the original location is drive
only (C:, D: etc.), then append a
backslash.
This commit is contained in:
Katayama Hirofumi MZ 2024-07-23 15:46:18 +09:00 committed by GitHub
parent b40046f426
commit 166c7ee33c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -768,7 +768,12 @@ HRESULT WINAPI CRecycleBin::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, LPS
pszBackslash = wcsrchr(pFileDetails->szName, L'\\');
Length = (pszBackslash - pFileDetails->szName);
memcpy((LPVOID)buffer, pFileDetails->szName, Length * sizeof(WCHAR));
buffer[Length] = L'\0';
buffer[Length] = UNICODE_NULL;
if (buffer[0] && buffer[1] == L':' && !buffer[2])
{
buffer[2] = L'\\';
buffer[3] = UNICODE_NULL;
}
break;
case COLUMN_SIZE:
StrFormatKBSizeW(pFileDetails->FileSize.QuadPart, buffer, MAX_PATH);