[gthumb] system bookmarks: do not include the initial space in the menu name



commit e616a61b16f4c709570cb171cac784e13077ea43
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Oct 20 12:04:03 2019 +0200

    system bookmarks: do not include the initial space in the menu name

 extensions/bookmarks/callbacks.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/extensions/bookmarks/callbacks.c b/extensions/bookmarks/callbacks.c
index ba6217da..25250a74 100644
--- a/extensions/bookmarks/callbacks.c
+++ b/extensions/bookmarks/callbacks.c
@@ -104,6 +104,7 @@ update_system_bookmark_list_from_content (GthBrowser *browser,
                char      **line;
                char       *uri;
                GFile      *file;
+               char       *first_space;
                char       *name;
                GMenuItem  *item;
 
@@ -115,7 +116,8 @@ update_system_bookmark_list_from_content (GthBrowser *browser,
                }
 
                file = g_file_new_for_uri (uri);
-               name = g_strdup (strchr (lines[i], ' '));
+               first_space = strchr (lines[i], ' ');
+               name = (first_space != NULL) ? g_strdup (first_space + 1) : NULL;
                if (name == NULL)
                        name = _g_file_get_display_name (file);
                if (name == NULL)


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