diff options
bookmarks: Check for access before reading, remove homepage
1 files changed, 5 insertions, 2 deletions
| -rw-r--r-- | bookmarks.c | 7 |
diff --git a/bookmarks.c b/bookmarks.c index 59faf95..dcf579d 100644 --- a/bookmarks.c +++ b/bookmarks.c @@ -6,6 +6,7 @@ #include <glib/gprintf.h> /* g_fprintf() */ #include <gtk/gtk.h> #include <libxml/xpath.h> +#include <unistd.h> /* access() */ static gboolean location_completion_matches(GtkEntryCompletion *completion, @@ -76,8 +77,10 @@ bookmarks_completion_init() GtkTreeIter iter; GtkListStore *list_store = gtk_list_store_new(1, G_TYPE_STRING); - gtk_list_store_append(list_store, &iter); - gtk_list_store_set(list_store, &iter, 0, homepage, -1); + if(access(filename, R_OK) != 0) { + g_fprintf(stderr, "Bookmarks: No loadable file found at %s\n", filename); + return NULL; + } g_fprintf(stderr, "Bookmarks: loading at %s\n", filename); doc = xmlParseFile(filename); |