All pastes #84926 Raw Edit

James Livingston

public text v1 · immutable
·published 2006-07-11 13:51 UTC
rendered paste body
diff -u -p -r1.11 rb-refstring.c
--- rhythmdb/rb-refstring.c	20 Apr 2006 20:43:28 -0000	1.11
+++ rhythmdb/rb-refstring.c	11 Jul 2006 13:49:33 -0000
@@ -167,8 +167,20 @@ rb_refstring_get_sort_key (RBRefString *
 	string = (const char*)g_atomic_pointer_get (ptr);
 	if (string == NULL) {
 		char *newstring;
+		const char *s;
+
+		s = rb_refstring_get_folded (val);
+		if (g_str_has_prefix (s, "the ")) {
+			char *str;
+	
+			newstring = g_strdup (s + strlen ("the "));
+			str = rb_utf8_collate_key_for_filename (newstring, -1);
+			g_free (newstring);
+			newstring = str;
+		} else {
+			newstring = rb_utf8_collate_key_for_filename (s, -1);
+		}
 
-		newstring = rb_utf8_collate_key_for_filename (rb_refstring_get_folded (val), -1);
 		if (g_atomic_pointer_compare_and_exchange (ptr, NULL, newstring)) {
 			string = newstring;
 		} else {