# HG changeset patch # User Giacomo Lozito # Date 1187820163 -7200 # Node ID a8430f6ea7a29b38b87ca399da38ac85d1298342 # Parent a3e002f56bd611eec341f6fd8e7a2232a97bfdc2 reverted a local change on xspf that wasn't supposed to be committed diff -r a3e002f56bd6 -r a8430f6ea7a2 src/xspf/xspf.c --- a/src/xspf/xspf.c Thu Aug 23 00:00:49 2007 +0200 +++ b/src/xspf/xspf.c Thu Aug 23 00:02:43 2007 +0200 @@ -331,34 +331,6 @@ xmlFreeDoc(doc); } -#define DEBUG_NOCTRL_VALIDATOR 1 - -static gboolean validate_no_cntrl(const gchar *str) -{ - /* str must have been validated! */ - const gchar *p = str; - glong len = g_utf8_strlen(str, -1), i = 0; -#ifdef DEBUG_NOCTRL_VALIDATOR - g_print("xspf -> NOCTRL VALIDATING '%s', length %li ... ",str,len); -#endif - for ( i = 0 ; i < len - 1 ; i++ ) - { - p = g_utf8_next_char(p); - gunichar uc = g_utf8_get_char(p); - if ( g_unichar_iscntrl(uc) ) - { -#ifdef DEBUG_NOCTRL_VALIDATOR - g_print("NOCTRL VALIDATE FAIL!\n"); -#endif - return FALSE; - } - } -#ifdef DEBUG_NOCTRL_VALIDATOR - g_print("VALIDATE OK!\n"); -#endif - return TRUE; -} - static void playlist_save_xspf(const gchar *filename, gint pos) { xmlDocPtr doc; @@ -520,7 +492,7 @@ const gchar *scratch; if((scratch = tuple_get_string(entry->tuple, "title")) != NULL && - g_utf8_validate(scratch, -1, NULL) && validate_no_cntrl(scratch)) { + g_utf8_validate(scratch, -1, NULL)) { tmp = xmlNewNode(NULL, (xmlChar *)"title"); xmlAddChild(tmp, xmlNewText((xmlChar *) scratch)); xmlAddChild(track, tmp); @@ -627,7 +599,7 @@ } /* tuple */ else { - if(entry->title != NULL && g_utf8_validate(entry->title, -1, NULL) && validate_no_cntrl(entry->title)) { + if(entry->title != NULL && g_utf8_validate(entry->title, -1, NULL)) { tmp = xmlNewNode(NULL, (xmlChar *)"title"); xmlAddChild(tmp, xmlNewText((xmlChar *)entry->title)); xmlAddChild(track, tmp);