Commit f78b4f30 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

xmllite: Reader should set starting string offsets when encoding is being parsed.

parent 493e406b
...@@ -1071,6 +1071,8 @@ static HRESULT reader_parse_encname(xmlreader *reader, strval *val) ...@@ -1071,6 +1071,8 @@ static HRESULT reader_parse_encname(xmlreader *reader, strval *val)
if ((*start < 'A' || *start > 'Z') && (*start < 'a' || *start > 'z')) if ((*start < 'A' || *start > 'Z') && (*start < 'a' || *start > 'z'))
return WC_E_ENCNAME; return WC_E_ENCNAME;
val->start = reader_get_cur(reader);
ptr = start; ptr = start;
while (is_wchar_encname(*++ptr)) while (is_wchar_encname(*++ptr))
; ;
...@@ -1100,6 +1102,7 @@ static HRESULT reader_parse_encdecl(xmlreader *reader) ...@@ -1100,6 +1102,7 @@ static HRESULT reader_parse_encdecl(xmlreader *reader)
if (reader_cmp(reader, encodingW)) return S_FALSE; if (reader_cmp(reader, encodingW)) return S_FALSE;
name.str = reader_get_ptr(reader); name.str = reader_get_ptr(reader);
name.start = reader_get_cur(reader);
name.len = 8; name.len = 8;
/* skip 'encoding' */ /* skip 'encoding' */
reader_skipn(reader, 8); reader_skipn(reader, 8);
......
...@@ -752,10 +752,6 @@ static void test_read_xmldeclaration(void) ...@@ -752,10 +752,6 @@ static void test_read_xmldeclaration(void)
hr = IXmlReader_GetValue(reader, &val, &len); hr = IXmlReader_GetValue(reader, &val, &len);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
ok(len == lstrlenW(name_val[i].val), "expected %u, got %u\n", lstrlenW(name_val[i].val), len); ok(len == lstrlenW(name_val[i].val), "expected %u, got %u\n", lstrlenW(name_val[i].val), len);
if (i == 1)
todo_wine
ok(!lstrcmpW(name_val[i].val, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].val), wine_dbgstr_w(val));
else
ok(!lstrcmpW(name_val[i].val, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].val), wine_dbgstr_w(val)); ok(!lstrcmpW(name_val[i].val, val), "expected %s, got %s\n", wine_dbgstr_w(name_val[i].val), wine_dbgstr_w(val));
hr = IXmlReader_MoveToNextAttribute(reader); hr = IXmlReader_MoveToNextAttribute(reader);
......
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