[SHELL32] Move SheRemoveQuotesA/W to utils.cpp (#5535)

* [SHELL32] Move SheRemoveQuotesA/W to utils.cpp

Follow-up to #5529 (7100fa8).
JIRA issue: CORE-9277
This commit is contained in:
Katayama Hirofumi MZ 2023-08-06 20:07:39 +09:00 committed by GitHub
parent 365372dc17
commit 6413024cab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 48 deletions

View file

@ -40,6 +40,7 @@ list(APPEND SOURCE
folders.cpp
iconcache.cpp
shell32.cpp
utils.cpp
CShellItem.cpp
CShellLink.cpp
CFolderOptions.cpp

View file

@ -987,54 +987,6 @@ HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD l
return hIcon;
}
/*************************************************************************
* SheRemoveQuotesA (SHELL32.@)
*/
EXTERN_C LPSTR
WINAPI
SheRemoveQuotesA(LPSTR psz)
{
PCHAR pch;
if (*psz == '"')
{
for (pch = psz + 1; *pch && *pch != '"'; ++pch)
{
*(pch - 1) = *pch;
}
if (*pch == '"')
*(pch - 1) = ANSI_NULL;
}
return psz;
}
/*************************************************************************
* SheRemoveQuotesW (SHELL32.@)
*
* ExtractAssociatedIconExW uses this function.
*/
EXTERN_C LPWSTR
WINAPI
SheRemoveQuotesW(LPWSTR psz)
{
PWCHAR pch;
if (*psz == L'"')
{
for (pch = psz + 1; *pch && *pch != L'"'; ++pch)
{
*(pch - 1) = *pch;
}
if (*pch == L'"')
*(pch - 1) = UNICODE_NULL;
}
return psz;
}
/*************************************************************************
* ExtractAssociatedIconExW (SHELL32.@)
*

View file

@ -0,0 +1,58 @@
/*
* PROJECT: shell32
* LICENSE: LGPL-2.1+ (https://spdx.org/licenses/LGPL-2.1+)
* PURPOSE: Utility functions
* COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include "precomp.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
/*************************************************************************
* SheRemoveQuotesA (SHELL32.@)
*/
EXTERN_C LPSTR
WINAPI
SheRemoveQuotesA(LPSTR psz)
{
PCHAR pch;
if (*psz == '"')
{
for (pch = psz + 1; *pch && *pch != '"'; ++pch)
{
*(pch - 1) = *pch;
}
if (*pch == '"')
*(pch - 1) = ANSI_NULL;
}
return psz;
}
/*************************************************************************
* SheRemoveQuotesW (SHELL32.@)
*
* ExtractAssociatedIconExW uses this function.
*/
EXTERN_C LPWSTR
WINAPI
SheRemoveQuotesW(LPWSTR psz)
{
PWCHAR pch;
if (*psz == L'"')
{
for (pch = psz + 1; *pch && *pch != L'"'; ++pch)
{
*(pch - 1) = *pch;
}
if (*pch == L'"')
*(pch - 1) = UNICODE_NULL;
}
return psz;
}