From 43c870010532fbe47a21d1e3478893b595d85ce8 Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Thu, 3 Sep 2009 21:17:08 -0700 Subject: [PATCH] Fix making paths relative (kdenlive-1111). Signed-off-by: Dan Dennedy --- src/modules/xml/consumer_xml.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c index 187d626c..fae400b0 100644 --- a/src/modules/xml/consumer_xml.c +++ b/src/modules/xml/consumer_xml.c @@ -191,8 +191,9 @@ 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 ) ) ) - value += strlen( context->root ) + 1; + int rootlen = strlen( context->root ); + if ( rootlen && !strncmp( value, context->root, rootlen ) && value[ rootlen ] == '/' ) + value += rootlen + 1; p = xmlNewTextChild( node, NULL, _x("property"), _x(value) ); xmlNewProp( p, _x("name"), _x(name) ); } @@ -213,8 +214,9 @@ 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 ) ) ) - value += strlen( context->root ) + 1; + int rootlen = strlen( context->root ); + if ( rootlen && !strncmp( value, context->root, rootlen ) && value[ rootlen ] == '/' ) + value += rootlen + 1; p = xmlNewTextChild( node, NULL, _x("property"), _x(value) ); xmlNewProp( p, _x("name"), _x(name) ); } -- 2.39.2