mirror of
https://github.com/ValveSoftware/Proton.git
synced 2024-12-27 07:05:46 +03:00
steam_helper: Make file extension check case-insensitive
(cherry picked from commit 9686e84a65
)
This commit is contained in:
parent
53d18030e6
commit
46cdf7f6a9
@ -466,6 +466,16 @@ static BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL streq_niw(const WCHAR *l, const WCHAR *r, size_t len)
|
||||
{
|
||||
while(len > 0){
|
||||
if(towlower(*l) != towlower(*r))
|
||||
return FALSE;
|
||||
++l; ++r; --len;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL should_use_shell_execute(const WCHAR *cmdline)
|
||||
{
|
||||
BOOL use_shell_execute = TRUE;
|
||||
@ -492,7 +502,7 @@ static BOOL should_use_shell_execute(const WCHAR *cmdline)
|
||||
{
|
||||
static const WCHAR exeW[] = {'.','e','x','e',0};
|
||||
|
||||
if (!strncmpW(executable_name_end, exeW, wcslen(exeW)))
|
||||
if (streq_niw(executable_name_end, exeW, sizeof(exeW) / sizeof(*exeW) - 1))
|
||||
use_shell_execute = FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user