[rhythmbox] text-helpers: kill the leading space



commit 7e56ebfefad3f514bfce22acc0b6202206908e66
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Nov 6 07:34:22 2012 +1000

    text-helpers: kill the leading space
    
    Checking if the length of the string is zero isn't a good way to
    see if you've formatted anything into it yet when you always write
    a direction mark character first.

 lib/rb-text-helpers.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/lib/rb-text-helpers.c b/lib/rb-text-helpers.c
index be0b4d5..f8cd2ee 100644
--- a/lib/rb-text-helpers.c
+++ b/lib/rb-text-helpers.c
@@ -177,6 +177,7 @@ rb_text_cat (PangoDirection base_dir, ...)
 	const char *embed_start;
 	const char *embed_stop = UNICODE_PDF;
 	GString *result;
+	int first_char;
 
 	va_start (args, base_dir);
 
@@ -191,6 +192,7 @@ rb_text_cat (PangoDirection base_dir, ...)
 		g_string_append (result, UNICODE_RLM);
 		embed_start = UNICODE_LRE;
 	}
+	first_char = result->len;
 
 	while (1) {
 		const char *text = va_arg (args, const char *);
@@ -205,7 +207,7 @@ rb_text_cat (PangoDirection base_dir, ...)
 		if (!format[0])
 			format = "%s";
 
-		if (result->len > 0) {
+		if (result->len > first_char) {
 			g_string_append (result, " ");
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]