diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2012-01-03 19:29:20 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2012-01-03 19:29:20 +0000 |
commit | 6b42d70d7c3459f800ede90fabece98ebb8b47db (patch) | |
tree | 841fa256294642ed772bbe1a80fa58c01946df4f /finch/finch.c | |
parent | 72cc203dbf9d978555ad7e979f9c9f14a93f98a6 (diff) | |
download | pidgin-6b42d70d7c3459f800ede90fabece98ebb8b47db.tar.gz |
pidgin/finch: Make relative paths absolute with -c
With a relative path (-c .purple-test), the WebKit message view
rendering wasn't loading my theme code nor icons properly (which
suggests that the webkit has a different base file URI).
Diffstat (limited to 'finch/finch.c')
-rw-r--r-- | finch/finch.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/finch/finch.c b/finch/finch.c index 5157e8016c..1af4e87694 100644 --- a/finch/finch.c +++ b/finch/finch.c @@ -339,7 +339,17 @@ init_libpurple(int argc, char **argv) /* set a user-specified config directory */ if (opt_config_dir_arg != NULL) { - purple_util_set_user_dir(opt_config_dir_arg); + if (g_path_is_absolute(opt_config_dir_arg)) { + purple_util_set_user_dir(opt_config_dir_arg); + } else { + /* Make an absolute (if not canonical) path */ + char *cwd = g_get_current_dir(); + char *path = g_build_path(G_DIR_SEPARATOR_S, cwd, opt_config_dir_arg, NULL); + purple_util_set_user_dir(path); + g_free(path); + g_free(cwd); + } + g_free(opt_config_dir_arg); } |