From: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- dlls/msxml3/saxreader.c | 16 +++++++++++++--- dlls/msxml3/tests/saxreader.c | 16 ++++++++-------- dlls/msxml4/tests/saxreader.c | 2 +- dlls/msxml6/tests/saxreader.c | 2 +- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 89e76add533..94a7415cba0 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -3728,9 +3728,19 @@ static BSTR saxreader_parse_attvalue(struct saxlocator *locator) } else { - ch = *saxreader_get_ptr_noread(locator); - saxreader_string_append(locator, &buffer, &ch, 1); - saxreader_skip(locator, 1); + if (saxreader_cmp(locator, L"\r\n") + || saxreader_cmp(locator, L"\r") + || saxreader_cmp(locator, L"\n") + || saxreader_cmp(locator, L"\t")) + { + saxreader_string_append(locator, &buffer, L" ", 1); + } + else + { + ch = *saxreader_get_ptr_noread(locator); + saxreader_string_append(locator, &buffer, &ch, 1); + saxreader_skip(locator, 1); + } } } diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index c5a73a8d254..58dd1c8cd2e 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -2969,7 +2969,7 @@ static struct call_entry normalize_line_breaks_off_text_seq[] = static struct attribute_entry normalize_line_breaks_attrs[] = { - { L"", L"attr", L"attr", L"a b" }, + { L"", L"attr", L"attr", L"a b c d" }, { NULL } }; @@ -2977,8 +2977,8 @@ static struct call_entry normalize_line_breaks_attr_seq[] = { { CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK }, { CH_STARTDOCUMENT, 0, 0, S_OK }, - { CH_STARTELEMENT, 2, 5, S_OK, L"", L"e", L"e", normalize_line_breaks_attrs }, - { CH_ENDELEMENT, 2, 7, S_OK, L"", L"e", L"e" }, + { CH_STARTELEMENT, 3, 5, S_OK, L"", L"e", L"e", normalize_line_breaks_attrs }, + { CH_ENDELEMENT, 3, 7, S_OK, L"", L"e", L"e" }, { CH_ENDDOCUMENT, 0, 0, S_OK }, { CH_ENDTEST } }; @@ -3049,8 +3049,8 @@ static struct call_entry normalize_line_breaks_off_pi_seq[] = { CH_PUTDOCUMENTLOCATOR, 0, 0, S_OK }, { CH_STARTDOCUMENT, 0, 0, S_OK }, { CH_STARTELEMENT, 1, 4, S_OK, L"", L"e", L"e" }, - { CH_PROCESSINGINSTRUCTION, 1, 9, S_OK, L"pi", L"ab\rc " }, - { CH_ENDELEMENT, 2, 7, S_OK, L"", L"e", L"e" }, + { CH_PROCESSINGINSTRUCTION, 1, 9, S_OK, L"pi", L"ab\rc \r\nd " }, + { CH_ENDELEMENT, 3, 7, S_OK, L"", L"e", L"e" }, { CH_ENDDOCUMENT, 0, 0, S_OK }, { CH_ENDTEST } }; @@ -3109,7 +3109,7 @@ static void test_saxreader_normalize_line_breaks(void) /* Attribute values */ V_VT(&var) = VT_BSTR; - V_BSTR(&var) = _bstr_("<e attr=\"a\rb\" ></e>"); + V_BSTR(&var) = _bstr_("<e attr=\"a\rb\nc\r\nd\" ></e>"); set_expected_seq(normalize_line_breaks_attr_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -3154,7 +3154,7 @@ static void test_saxreader_normalize_line_breaks(void) /* Attribute values */ V_VT(&var) = VT_BSTR; - V_BSTR(&var) = _bstr_("<e attr=\"a\rb\" ></e>"); + V_BSTR(&var) = _bstr_("<e attr=\"a\rb\nc\r\nd\" ></e>"); set_expected_seq(normalize_line_breaks_attr_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -3178,7 +3178,7 @@ static void test_saxreader_normalize_line_breaks(void) /* PI */ V_VT(&var) = VT_BSTR; - V_BSTR(&var) = _bstr_("<e><?pi ab\rc ?></e>"); + V_BSTR(&var) = _bstr_("<e><?pi ab\rc \r\nd ?></e>"); set_expected_seq(normalize_line_breaks_off_pi_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); diff --git a/dlls/msxml4/tests/saxreader.c b/dlls/msxml4/tests/saxreader.c index 75e6782b5af..8859e858eee 100644 --- a/dlls/msxml4/tests/saxreader.c +++ b/dlls/msxml4/tests/saxreader.c @@ -2311,7 +2311,7 @@ static void test_saxreader(void) set_expected_seq(test_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value normalization", TRUE); + ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value normalization", FALSE); IStream_Release(stream); resolver = (void*)0xdeadbeef; diff --git a/dlls/msxml6/tests/saxreader.c b/dlls/msxml6/tests/saxreader.c index a56b27d4916..4ecec94b9fc 100644 --- a/dlls/msxml6/tests/saxreader.c +++ b/dlls/msxml6/tests/saxreader.c @@ -4793,7 +4793,7 @@ static void test_saxreader(void) set_expected_seq(test_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); - ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value normalization", TRUE); + ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "attribute value normalization", FALSE); IStream_Release(stream); resolver = (void*)0xdeadbeef; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10183