From 10526bf79429335157fed311447dfb8206880245 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Thu, 24 Jun 2010 14:07:26 +0200 Subject: [PATCH] Append slashes to directories in cc_open This patch appends slashes to directories in cc_open. In addition lines in zathurarc that do not end with a new line won't be ignored anymore. Thanks to Trundle --- zathura.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zathura.c b/zathura.c index 60dd4a7..1dfd4a5 100644 --- a/zathura.c +++ b/zathura.c @@ -1347,7 +1347,7 @@ read_configuration() int n = g_strv_length(lines) - 1; int i; - for(i = 0; i < n; i++) + for(i = 0; i <= n; i++) { if(!strlen(lines[i])) continue; @@ -3359,6 +3359,12 @@ cc_open(char* input) out_of_memory(); el->value = g_strdup_printf("%s%s", path, d_name); + if(g_file_test(el->value, G_FILE_TEST_IS_DIR)) + { + gchar *subdir = el->value; + el->value = g_strdup_printf("%s/", subdir); + g_free(subdir); + } el->description = NULL; el->next = NULL;