summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-05-09 23:27:35 +0200
committerportix <portix@gmx.net>2011-05-09 23:27:35 +0200
commitf94a58cec67b4d31ac1a7bf79151523629fc94ae (patch)
tree086e33a9a0d49011ae0767aed0704d0f5df12fe1 /src/util.c
parentea99a455bfd24cbf11bdfb8e6cef1caac7b2ec48 (diff)
parentde008793cbf4cdbcd43ed79d659d86c97dc0ce74 (diff)
downloaddwb-f94a58cec67b4d31ac1a7bf79151523629fc94ae.zip
merge with branch 'html'
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index b6e9d33b..bc288fd1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -207,7 +207,12 @@ dwb_util_arg_to_char(Arg *arg, DwbType type) {
/* dwb_util_navigation_sort_first {{{*/
int
dwb_util_navigation_compare_first(Navigation *a, Navigation *b) {
- return (strcmp(b->first, b->first));
+ return (strcmp(a->first, b->first));
+}/*}}}*/
+/* dwb_util_navigation_sort_first {{{*/
+int
+dwb_util_navigation_compare_second(Navigation *a, Navigation *b) {
+ return (strcmp(a->second, b->second));
}/*}}}*/
/* dwb_util_keymap_sort_first(KeyMap *, KeyMap *) {{{*/
int
@@ -332,6 +337,16 @@ dwb_util_get_data_dir(const char *dir) {
}
return NULL;
}/*}}}*/
+char *
+dwb_util_get_data_file(const char *filename) {
+ char *path = dwb_util_get_data_dir("lib");
+ char *ret = g_build_filename(path, filename, NULL);
+ g_free(path);
+ if (g_file_test(ret, G_FILE_TEST_EXISTS)) {
+ return ret;
+ }
+ return NULL;
+}
/* NAVIGATION {{{*/
/* dwb_navigation_new(const char *uri, const char *title) {{{*/