Commit 4d794646 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

setupapi: Fix parsing of UCS-16 files.

Fix parsing of UCS-16 files prefixed with the Unicode BOM. Based on a patch by Hervé Poussineau.
parent 32d39ea6
......@@ -967,7 +967,14 @@ static struct inf_file *parse_file( HANDLE handle, const WCHAR *class, UINT *err
HeapFree( GetProcessHeap(), 0, new_buff );
}
}
else err = parse_buffer( file, buffer, (WCHAR *)((char *)buffer + size), error_line );
else
{
WCHAR *new_buff = (WCHAR *)buffer;
/* UCS-16 files should start with the Unicode BOM; we should skip it */
if (*new_buff == 0xfeff)
new_buff++;
err = parse_buffer( file, new_buff, (WCHAR *)((char *)buffer + size), error_line );
}
if (!err) /* now check signature */
{
......
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