pidgin: 3100be30: pidgin/finch: Make relative paths absolu..

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Jan 3 14:31:32 EST 2012


----------------------------------------------------------------------
Revision: 3100be309efb98a39bb8ef745c0302722534234a
Parent:   9164820bde91849288dddb4eaffef612d203b848
Author:   darkrain42 at pidgin.im
Date:     01/03/12 14:29:20
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3100be309efb98a39bb8ef745c0302722534234a

Changelog: 

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).

Changes against parent 9164820bde91849288dddb4eaffef612d203b848

  patched  finch/finch.c
  patched  pidgin/gtkmain.c

-------------- next part --------------
============================================================
--- pidgin/gtkmain.c	a9ac9e187f2795dcfefd272c40eed775819bd991
+++ pidgin/gtkmain.c	bdff679de7f95862343ec6d7ce0f7b65fb42f4ea
@@ -719,7 +719,16 @@ int main(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);
+		}
 	}
 
 	/*
============================================================
--- finch/finch.c	dda69bf846f829e3e554b8b301b564cfce5338ae
+++ finch/finch.c	737d60388a1bc1dd645d98acc0d09b3e66b88ffe
@@ -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);
 	}
 


More information about the Commits mailing list