Module: wine Branch: master Commit: 4f0b912236fc8f7d72c5d50a6c9b784b80839b42 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4f0b912236fc8f7d72c5d50a6c...
Author: Hans Leidekker hans@codeweavers.com Date: Thu Jan 21 15:27:54 2016 +0100
webservices: Simplify handling of quotes in write_attribute.
Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/webservices/writer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/webservices/writer.c b/dlls/webservices/writer.c index e7fa915..ece5ad1 100644 --- a/dlls/webservices/writer.c +++ b/dlls/webservices/writer.c @@ -453,6 +453,7 @@ static inline void write_bytes( struct writer *writer, const BYTE *bytes, ULONG static HRESULT write_attribute( struct writer *writer, WS_XML_ATTRIBUTE *attr ) { WS_XML_UTF8_TEXT *text = (WS_XML_UTF8_TEXT *)attr->value; + unsigned char quote = attr->singleQuote ? ''' : '"'; ULONG size; HRESULT hr;
@@ -471,11 +472,9 @@ static HRESULT write_attribute( struct writer *writer, WS_XML_ATTRIBUTE *attr ) } write_bytes( writer, attr->localName->bytes, attr->localName->length ); write_char( writer, '=' ); - if (attr->singleQuote) write_char( writer, ''' ); - else write_char( writer, '"' ); + write_char( writer, quote ); if (text) write_bytes( writer, text->value.bytes, text->value.length ); - if (attr->singleQuote) write_char( writer, ''' ); - else write_char( writer, '"' ); + write_char( writer, quote );
/* FIXME: ignoring namespace */ return S_OK;