Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit5af5a723bfa9a3da2df754e63a3833445ecdb49b (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-08-22 07:53:38 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2020-08-22 09:00:21 +0200
Files08d8b1fc1b3c3cbd1a2bba80d09c64a1c8370090
goodwolf-5af5a723bfa9a3da2df754e63a3833445ecdb49b.tar
goodwolf-5af5a723bfa9a3da2df754e63a3833445ecdb49b.tar.gz
goodwolf-5af5a723bfa9a3da2df754e63a3833445ecdb49b.zip
Parent720eb415a73893bf4c3894c10e27c66996f7e67e (diff)
bookmarks: Check for access before reading, remove homepage
1 files changed, 5 insertions, 2 deletions
-rw-r--r--bookmarks.c7
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);