Clipit patch to fix endline in menu

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
diff -Naur clipit-1.4.1.orig/src/utils.c clipit-1.4.1/src/utils.c
--- clipit-1.4.1.orig/src/utils.c 2011-05-27 10:10:07.000000000 +0300
+++ clipit-1.4.1/src/utils.c 2014-08-05 21:18:29.343103476 +0300
@@ -68,6 +68,14 @@
/* Ellipsize a string according to the settings */
GString *ellipsize_string(GString *string)
{
+ gint pos = 0;
+ do {
+ if( string->str[pos] == '\r' ||
+ string->str[pos] == '\n' ) {
+ string = g_string_erase(string, pos, 1);
+ }
+ } while (pos++ < string->len);
+
gboolean is_utf8 = g_utf8_validate(string->str, -1, NULL);
gint str_len = is_utf8 ? g_utf8_strlen(string->str, -1) : string->len;
if (str_len > prefs.item_length)