From: Bruno Haible Date: Mon, 29 May 2023 09:41:07 +0000 (+0200) Subject: libxml: Fix compilation error with gcc < 10 (regression 2023-05-26). X-Git-Tag: v0.22~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36cc99cdc6c58e81a4e00a80315774fe5c7e299c;p=thirdparty%2Fgettext.git libxml: Fix compilation error with gcc < 10 (regression 2023-05-26). * gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Add braces. --- diff --git a/gnulib-local/lib/libxml/tree.c b/gnulib-local/lib/libxml/tree.c index 0c3f792b0..55ad9e8d9 100644 --- a/gnulib-local/lib/libxml/tree.c +++ b/gnulib-local/lib/libxml/tree.c @@ -9514,25 +9514,27 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt, /* * Attributes (xmlAttr). */ - xmlAttrPtr cloneAttr = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); - if (cloneAttr == NULL) { - xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node"); - goto internal_error; - } - memset(cloneAttr, 0, sizeof(xmlAttr)); - /* - * Set hierachical links. - * TODO: Change this to add to the end of attributes. - */ - if (resultClone != NULL) { - cloneAttr->parent = parentClone; - if (prevClone) { - prevClone->next = (xmlNodePtr) cloneAttr; - cloneAttr->prev = (xmlAttrPtr) prevClone; + { + xmlAttrPtr cloneAttr = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); + if (cloneAttr == NULL) { + xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node"); + goto internal_error; + } + memset(cloneAttr, 0, sizeof(xmlAttr)); + /* + * Set hierachical links. + * TODO: Change this to add to the end of attributes. + */ + if (resultClone != NULL) { + cloneAttr->parent = parentClone; + if (prevClone) { + prevClone->next = (xmlNodePtr) cloneAttr; + cloneAttr->prev = (xmlAttrPtr) prevClone; + } else + parentClone->properties = (xmlAttrPtr) cloneAttr; } else - parentClone->properties = (xmlAttrPtr) cloneAttr; - } else - resultClone = (xmlNodePtr) cloneAttr; + resultClone = (xmlNodePtr) cloneAttr; + } break; default: /*