Commit c23ce597 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

xmllite: Fix equal sign parsing.

parent 8b8fb88e
...@@ -48,7 +48,6 @@ static const WCHAR utf8W[] = {'U','T','F','-','8',0}; ...@@ -48,7 +48,6 @@ static const WCHAR utf8W[] = {'U','T','F','-','8',0};
static const WCHAR dblquoteW[] = {'\"',0}; static const WCHAR dblquoteW[] = {'\"',0};
static const WCHAR quoteW[] = {'\'',0}; static const WCHAR quoteW[] = {'\'',0};
static const WCHAR eqW[] = {'=',0};
struct xml_encoding_data struct xml_encoding_data
{ {
...@@ -515,6 +514,18 @@ static HRESULT reader_parse_versionnum(xmlreader *reader) ...@@ -515,6 +514,18 @@ static HRESULT reader_parse_versionnum(xmlreader *reader)
return S_OK; return S_OK;
} }
/* [25] Eq ::= S? '=' S? */
static HRESULT reader_parse_eq(xmlreader *reader)
{
static const WCHAR eqW[] = {'=',0};
reader_skipspaces(reader);
if (reader_cmp(reader, eqW)) return WC_E_EQUAL;
/* skip '=' */
reader_skipn(reader, 1);
reader_skipspaces(reader);
return S_OK;
}
/* [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') */ /* [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') */
static HRESULT reader_parse_versioninfo(xmlreader *reader) static HRESULT reader_parse_versioninfo(xmlreader *reader)
{ {
...@@ -527,9 +538,8 @@ static HRESULT reader_parse_versioninfo(xmlreader *reader) ...@@ -527,9 +538,8 @@ static HRESULT reader_parse_versioninfo(xmlreader *reader)
/* skip 'version' */ /* skip 'version' */
reader_skipn(reader, 7); reader_skipn(reader, 7);
if (reader_cmp(reader, eqW)) return WC_E_EQUAL; hr = reader_parse_eq(reader);
/* skip '=' */ if (FAILED(hr)) return hr;
reader_skipn(reader, 1);
if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW)) if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW))
return WC_E_QUOTE; return WC_E_QUOTE;
...@@ -596,9 +606,8 @@ static HRESULT reader_parse_encdecl(xmlreader *reader) ...@@ -596,9 +606,8 @@ static HRESULT reader_parse_encdecl(xmlreader *reader)
/* skip 'encoding' */ /* skip 'encoding' */
reader_skipn(reader, 8); reader_skipn(reader, 8);
if (reader_cmp(reader, eqW)) return WC_E_EQUAL; hr = reader_parse_eq(reader);
/* skip '=' */ if (FAILED(hr)) return hr;
reader_skipn(reader, 1);
if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW)) if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW))
return WC_E_QUOTE; return WC_E_QUOTE;
...@@ -624,6 +633,7 @@ static HRESULT reader_parse_sddecl(xmlreader *reader) ...@@ -624,6 +633,7 @@ static HRESULT reader_parse_sddecl(xmlreader *reader)
static const WCHAR yesW[] = {'y','e','s',0}; static const WCHAR yesW[] = {'y','e','s',0};
static const WCHAR noW[] = {'n','o',0}; static const WCHAR noW[] = {'n','o',0};
const WCHAR *start, *ptr; const WCHAR *start, *ptr;
HRESULT hr;
if (!reader_skipspaces(reader)) return WC_E_WHITESPACE; if (!reader_skipspaces(reader)) return WC_E_WHITESPACE;
...@@ -631,9 +641,8 @@ static HRESULT reader_parse_sddecl(xmlreader *reader) ...@@ -631,9 +641,8 @@ static HRESULT reader_parse_sddecl(xmlreader *reader)
/* skip 'standalone' */ /* skip 'standalone' */
reader_skipn(reader, 10); reader_skipn(reader, 10);
if (reader_cmp(reader, eqW)) return WC_E_EQUAL; hr = reader_parse_eq(reader);
/* skip '=' */ if (FAILED(hr)) return hr;
reader_skipn(reader, 1);
if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW)) if (reader_cmp(reader, quoteW) && reader_cmp(reader, dblquoteW))
return WC_E_QUOTE; return WC_E_QUOTE;
......
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