Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
eb72aa05
Commit
eb72aa05
authored
Sep 19, 2008
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Fix xmlnode_get_xml to work properly with XML_DOCUMENT_NODE.
parent
a28b604f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
node.c
dlls/msxml3/node.c
+43
-1
No files found.
dlls/msxml3/node.c
View file @
eb72aa05
...
...
@@ -1085,6 +1085,37 @@ static BSTR EnsureCorrectEOL(BSTR sInput)
return
sNew
;
}
/* Removes encoding information and last character (nullbyte) */
static
BSTR
EnsureNoEncoding
(
BSTR
sInput
)
{
static
const
WCHAR
wszEncoding
[]
=
{
'e'
,
'n'
,
'c'
,
'o'
,
'd'
,
'i'
,
'n'
,
'g'
,
'='
};
BSTR
sNew
;
WCHAR
*
pBeg
,
*
pEnd
;
pBeg
=
sInput
;
while
(
*
pBeg
!=
'\n'
&&
memcmp
(
pBeg
,
wszEncoding
,
sizeof
(
wszEncoding
)))
pBeg
++
;
if
(
*
pBeg
==
'\n'
)
{
SysReAllocStringLen
(
&
sInput
,
sInput
,
SysStringLen
(
sInput
)
-
1
);
return
sInput
;
}
pBeg
--
;
pEnd
=
pBeg
+
sizeof
(
wszEncoding
)
/
sizeof
(
WCHAR
)
+
2
;
while
(
*
pEnd
!=
'\"'
)
pEnd
++
;
pEnd
++
;
sNew
=
SysAllocStringLen
(
NULL
,
pBeg
-
sInput
+
SysStringLen
(
sInput
)
-
(
pEnd
-
sInput
)
-
1
);
memcpy
(
sNew
,
sInput
,
(
pBeg
-
sInput
)
*
sizeof
(
WCHAR
));
memcpy
(
&
sNew
[
pBeg
-
sInput
],
pEnd
,
(
SysStringLen
(
sInput
)
-
(
pEnd
-
sInput
)
-
1
)
*
sizeof
(
WCHAR
));
SysFreeString
(
sInput
);
return
sNew
;
}
/*
* We are trying to replicate the same behaviour as msxml by converting
* line endings to \r\n and using idents as \t. The problem is that msxml
...
...
@@ -1123,7 +1154,18 @@ static HRESULT WINAPI xmlnode_get_xml(
else
bstrContent
=
bstr_from_xmlChar
(
pContent
);
*
xmlString
=
This
->
node
->
type
==
XML_ELEMENT_NODE
?
EnsureCorrectEOL
(
bstrContent
)
:
bstrContent
;
switch
(
This
->
node
->
type
)
{
case
XML_ELEMENT_NODE
:
*
xmlString
=
EnsureCorrectEOL
(
bstrContent
);
break
;
case
XML_DOCUMENT_NODE
:
*
xmlString
=
EnsureCorrectEOL
(
bstrContent
);
*
xmlString
=
EnsureNoEncoding
(
*
xmlString
);
break
;
default:
*
xmlString
=
bstrContent
;
}
}
xmlBufferFree
(
pXmlBuf
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment