[cairo-commit] libsvg/src svg_image.c, 1.12, 1.13 svg_parser.c, 1.29, 1.30

Carl Worth commit at pdx.freedesktop.org
Tue May 4 09:18:10 PDT 2004


Committed by: cworth

Update of /cvs/cairo/libsvg/src
In directory pdx:/tmp/cvs-serv6468/src

Modified Files:
	svg_image.c svg_parser.c 
Log Message:

        * src/svg_parser.c (_svg_parser_sax_entity_decl): Fix missing
        initialization of entity fields URI, orig, owner, and children.

        * src/svg_image.c (_svg_image_init_copy): Fix missing copy of
        image->url.


Index: svg_image.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_image.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** a/svg_image.c	30 Aug 2003 03:09:07 -0000	1.12
--- b/svg_image.c	4 May 2004 16:18:07 -0000	1.13
***************
*** 64,67 ****
--- 64,71 ----
  {
      *image = *other;
+     if (other->url)
+ 	image->url = strdup (other->url);
+     else
+ 	image->url = NULL;
  
      return SVG_STATUS_SUCCESS;

Index: svg_parser.c
===================================================================
RCS file: /cvs/cairo/libsvg/src/svg_parser.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** a/svg_parser.c	30 Apr 2004 06:50:33 -0000	1.29
--- b/svg_parser.c	4 May 2004 16:18:07 -0000	1.30
***************
*** 331,334 ****
--- 331,337 ----
  }
  
+ /* XXX: It's not clear to my why we have to do this. libxml2 has all
+  * of this code internally, so we should be able to access a hash of
+  * entities automatically rather than maintaining our own. */
  static void
  _svg_parser_sax_entity_decl (void		*closure,
***************
*** 347,362 ****
      entity->name = xmlMemStrdup (name);
      entity->etype = type;
!     entity->ExternalID = xmlMemStrdup (publicId);
!     entity->SystemID = xmlMemStrdup (systemId);
  
      if (content) {
! 	entity->content = xmlMemStrdup (content);
! 	entity->length = strlen (content);
      } else {
- 	entity->content = NULL;
  	entity->length = 0;
      }
  
!     xmlHashAddEntry (parser->entities, name, entity); 
  }
  
--- 350,378 ----
      entity->name = xmlMemStrdup (name);
      entity->etype = type;
!     if (publicId)
! 	entity->ExternalID = xmlMemStrdup (publicId);
!     else
! 	entity->ExternalID = NULL;
!     if (systemId)
! 	entity->SystemID = xmlMemStrdup (systemId);
!     else
! 	entity->SystemID = NULL;
  
      if (content) {
! 	entity->length = xmlStrlen (content);
! 	entity->content = xmlStrndup (content, entity->length);
      } else {
  	entity->length = 0;
+ 	entity->content = NULL;
      }
+     entity->URI = NULL;
+     entity->orig = NULL;
+     entity->owner = 0;
+     entity->children = NULL;
  
!     if (xmlHashAddEntry (parser->entities, name, entity)) {
! 	/* Entity was already defined at another level. */
! 	free (entity);
!     }
  }
  





More information about the cairo-commit mailing list