Module: wine Branch: master Commit: c3e9780d223786acf838f2824b19104b4bd707cc URL: http://source.winehq.org/git/wine.git/?a=commit;h=c3e9780d223786acf838f2824b...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Sun Apr 20 00:09:58 2008 +1000
msxml3: Corrected IXMLDOMComment appendData with a broken xmlTextConcat function.
---
dlls/msxml3/comment.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index c4d37f2..eb273b4 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -597,10 +597,32 @@ static HRESULT WINAPI domcomment_appendData( pContent = xmlChar_from_wchar( (WCHAR*)p ); if(pContent) { + /* Older versions of libxml < 2.6.27 didn't correctly support + xmlTextConcat on Comment nodes. Fallback to setting the + contents directly if xmlTextConcat fails. + + NOTE: if xmlTextConcat fails, pContent is destroyed. + */ if(xmlTextConcat(pDOMNode->node, pContent, SysStringLen(p) ) == 0) hr = S_OK; else - hr = E_FAIL; + { + xmlChar *pNew; + pContent = xmlChar_from_wchar( (WCHAR*)p ); + if(pContent) + { + pNew = xmlStrcat(xmlNodeGetContent(pDOMNode->node), pContent); + if(pNew) + { + xmlNodeSetContent(pDOMNode->node, pNew); + hr = S_OK; + } + else + hr = E_FAIL; + } + else + hr = E_FAIL; + } } else hr = E_FAIL;