]> git.sesse.net Git - mlt/commitdiff
Fix making paths relative (kdenlive-1111).
authorDan Dennedy <dan@dennedy.org>
Fri, 4 Sep 2009 04:17:08 +0000 (21:17 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 4 Sep 2009 04:17:08 +0000 (21:17 -0700)
Signed-off-by: Dan Dennedy <dan@dennedy.org>
src/modules/xml/consumer_xml.c

index 187d626c09d2de9c62836628158348ea2b20a87e..fae400b0a8170b2b391d25411307aa1a95cb3f16 100644 (file)
@@ -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) );
                        }