Commit 4bbfd838 authored by Shaun Ren's avatar Shaun Ren Committed by Alexandre Julliard

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

parent 5243f2e8
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment