]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libxml: Fix compilation error with gcc < 10 (regression 2023-05-26).
authorBruno Haible <bruno@clisp.org>
Mon, 29 May 2023 09:41:07 +0000 (11:41 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 29 May 2023 09:41:07 +0000 (11:41 +0200)
* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Add braces.

gnulib-local/lib/libxml/tree.c

index 0c3f792b0b8717026386999f0bc8d4628eb6bf61..55ad9e8d92b7547f9582e1501b2d1bbd453f8e1d 100644 (file)
@@ -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:
                /*