sapi: Handle zero-length attributes correctly in ISpObjectTokenCategory::EnumTokens.

This commit is contained in:
Shaun Ren 2024-02-16 17:08:18 -05:00 committed by Alexandre Julliard
parent 5243f2e82c
commit 4bbfd83898
2 changed files with 11 additions and 1 deletions

View file

@ -205,6 +205,16 @@ static void test_token_category(void)
IEnumSpObjectTokens_Release( enum_tokens );
hr = ISpObjectTokenCategory_EnumTokens( cat, L"", NULL, &enum_tokens );
ok( hr == S_OK, "got %08lx\n", hr );
count = 0xdeadbeef;
hr = IEnumSpObjectTokens_GetCount( enum_tokens, &count );
ok( hr == S_OK, "got %08lx\n", hr );
ok( count == 5, "got %lu\n", count );
IEnumSpObjectTokens_Release( enum_tokens );
hr = ISpObjectTokenCategory_EnumTokens( cat, L"Language=409", NULL, &enum_tokens );
ok( hr == S_OK, "got %08lx\n", hr );

View file

@ -947,7 +947,7 @@ static HRESULT score_attributes( ISpObjectToken *token, const WCHAR *attrs,
unsigned int i, j;
HRESULT hr;
if (!attrs)
if (!attrs || !*attrs)
{
*score = 1;
return S_OK;