# HG changeset patch # User Matti Hamalainen # Date 1191341969 -10800 # Node ID f85a079573c39a762a56a12c6b9a66f2c5af4c68 # Parent 41d726acb915b6ee8ec2f60159b2975998b30775 More slight cosmetics. diff -r 41d726acb915 -r f85a079573c3 src/xspf/xspf.c --- a/src/xspf/xspf.c Tue Oct 02 19:17:46 2007 +0300 +++ b/src/xspf/xspf.c Tue Oct 02 19:19:29 2007 +0300 @@ -385,13 +385,11 @@ gint tmplen = 0; if (!is_uri(entry->filename)) { //obsolete - gchar *tmp2; - tmp2 = g_path_get_dirname(entry->filename); + gchar *tmp2 = g_path_get_dirname(entry->filename); tmp = g_strdup_printf("%s/", tmp2); g_free(tmp2); - } else { + } else tmp = g_strdup(entry->filename); - } if (!base) { base = strdup(tmp); @@ -414,10 +412,8 @@ base = tmp; baselen = tmplen; XSDEBUG("base='%s', baselen=%d\n", base, baselen); - } - else { + } else g_free(tmp); - } } /* set base URI */ @@ -436,8 +432,7 @@ tmp = g_strdup_printf("file://%s", base); xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)tmp); g_free(tmp); - } - else + } else xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)base); } } /* USE_RELATIVE */ @@ -482,8 +477,7 @@ if (is_uri(entry->filename)) { /* uri */ XSDEBUG("filename is uri\n"); filename = g_strdup(entry->filename + baselen); // entry->filename is always uri now. - } - else { /* local file (obsolete) */ + } else { /* local file (obsolete) */ gchar *tmp = (gchar *) xspf_path_to_uri((const xmlChar *)entry->filename + baselen); if (base) { /* relative */ filename = g_strdup_printf("%s", tmp);