fusion: Improve parse_display_name.

This commit is contained in:
Alexandre Goujon 2010-09-10 09:59:53 +02:00 committed by Alexandre Julliard
parent 4baf7a52f0
commit 135a70772d
2 changed files with 12 additions and 7 deletions

View File

@ -522,8 +522,16 @@ static HRESULT parse_display_name(IAssemblyNameImpl *name, LPCWSTR szAssemblyNam
if (!str)
return E_OUTOFMEMORY;
ptr = strstrW(str, separator);
ptr = strchrW(str, ',');
if (ptr) *ptr = '\0';
/* no ',' but ' ' only */
if( !ptr && strchrW(str, ' ') )
{
hr = FUSION_E_INVALID_NAME;
goto done;
}
name->name = strdupW(str);
if (!name->name)
return E_OUTOFMEMORY;

View File

@ -868,12 +868,9 @@ static void test_CreateAssemblyNameObject(void)
to_widechar(namestr, "wine PublicKeyToken=1234567890abcdef");
name = (IAssemblyName *)0xdeadbeef;
hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL);
todo_wine
{
ok(hr == FUSION_E_INVALID_NAME,
"Expected FUSION_E_INVALID_NAME, got %08x\n", hr);
ok(name == (IAssemblyName *)0xdeadbeef, "Expected 0xdeadbeef, got %p\n", name);
}
if(SUCCEEDED(hr)) IAssemblyName_Release(name);
/* no '=' */