Ignore both NULL and empty strings.

Fri, 11 Jan 2008 23:21:16 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Fri, 11 Jan 2008 23:21:16 +0000
changeset 22181
4b62573becd9
parent 22180
4efd851063bf
child 22208
cf83458e408b

Ignore both NULL and empty strings.

libpurple/util.c file | annotate | diff | comparison | revisions
--- a/libpurple/util.c	Thu Jan 10 02:28:48 2008 +0000
+++ b/libpurple/util.c	Fri Jan 11 23:21:16 2008 +0000
@@ -4659,7 +4659,7 @@
 	GString *string;
 	char *esc;
 
-	if (!title)
+	if (!title || !*title)
 		return NULL;
 
 	esc = g_markup_escape_text(title, -1);
@@ -4667,13 +4667,13 @@
 	g_string_append_printf(string, "%s", esc);
 	g_free(esc);
 
-	if (artist) {
+	if (artist && *artist) {
 		esc = g_markup_escape_text(artist, -1);
 		g_string_append_printf(string, _(" - %s"), esc);
 		g_free(esc);
 	}
 
-	if (album) {
+	if (album && *album) {
 		esc = g_markup_escape_text(album, -1);
 		g_string_append_printf(string, _(" (%s)"), esc);
 		g_free(esc);

mercurial