# HG changeset patch # User Paul Aurich # Date 1325618960 0 # Node ID 36fc641ca013f820a2c1d4548f980713adb42d0e # Parent f24f4e47dedbf9a2166e5af46b69db731111870e 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). diff -r f24f4e47dedb -r 36fc641ca013 finch/finch.c --- a/finch/finch.c Tue Jan 03 06:32:26 2012 +0000 +++ b/finch/finch.c Tue Jan 03 19:29:20 2012 +0000 @@ -339,7 +339,17 @@ /* 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); } diff -r f24f4e47dedb -r 36fc641ca013 pidgin/gtkmain.c --- a/pidgin/gtkmain.c Tue Jan 03 06:32:26 2012 +0000 +++ b/pidgin/gtkmain.c Tue Jan 03 19:29:20 2012 +0000 @@ -719,7 +719,16 @@ /* 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); + } } /*