Re: [Mlt-devel] Fix issue with xml "root" property [patch]
Brought to you by:
ddennedy,
lilo_booter
From: Dan D. <da...@de...> - 2009-09-04 04:15:04
|
On Thu, Sep 3, 2009 at 8:46 PM, Dan Dennedy<da...@de...> wrote: > This patch not correct - not a typo or being picky. It is just > functionally wrong. Sorry, I misread this. I had read value[] as root[strlen] == '/'. I am commiting a small variant of this. > On Thu, Sep 3, 2009 at 4:12 AM, jb <j-...@us...> wrote: >> >> On Thursday 03 September 2009 13:06:47 jb wrote: >> > Hi. >> > >> > The patch below fixes a bug recently reported: >> > http://www.kdenlive.org/mantis/view.php?id=1111 >> >> (...) and here is the correct patch, the previous one had an added bug. >> >> jb >> >> diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c >> index 187d626..f595a34 100644 >> --- a/src/modules/xml/consumer_xml.c >> +++ b/src/modules/xml/consumer_xml.c >> @@ -191,7 +191,7 @@ static void serialise_properties( serialise_context context, mlt_properties prop >> strcmp( name, "height" ) != 0 ) >> { >> char *value = mlt_properties_get_value( properties, i ); >> - if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) ) >> + if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) && value[ strlen( context->root ) ] == '/' ) >> value += strlen( context->root ) + 1; >> p = xmlNewTextChild( node, NULL, _x("property"), _x(value) ); >> xmlNewProp( p, _x("name"), _x(name) ); >> @@ -213,7 +213,7 @@ static void serialise_store_properties( serialise_context context, mlt_propertie >> char *value = mlt_properties_get_value( properties, i ); >> if ( value != NULL ) >> { >> - if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) ) >> + if ( strcmp( context->root, "" ) && !strncmp( value, context->root, strlen( context->root ) ) && value[ strlen( context->root ) ] == '/' ) >> value += strlen( context->root ) + 1; >> p = xmlNewTextChild( node, NULL, _x("property"), _x(value) ); >> xmlNewProp( p, _x("name"), _x(name) ); >> >> > > -- > +-DRD-+ > -- +-DRD-+ |