--- a/libpurple/util.c Mon Apr 09 00:02:14 2007 +0000 +++ b/libpurple/util.c Mon Apr 09 00:03:04 2007 +0000 @@ -2184,8 +2184,8 @@ #endif } -/* returns a string of the form ~/.gaim, where ~ is replaced by the user's home - * dir. Note that there is no trailing slash after .gaim. */ +/* Returns the argument passed to -c IFF it was present, or ~/.gaim IFF it + * exists, else ~/.purple. */ const char * purple_user_dir(void) { @@ -2198,6 +2198,13 @@ g_strlcpy((char*) &home_dir, hd, sizeof(home_dir)); g_strlcat((char*) &home_dir, G_DIR_SEPARATOR_S ".gaim", sizeof(home_dir)); + + if (g_file_test(home_dir, G_FILE_TEST_EXISTS)) + return home_dir; + + g_strlcpy((char*) &home_dir, hd, sizeof(home_dir)); + g_strlcat((char*) &home_dir, G_DIR_SEPARATOR_S ".purple", + sizeof(home_dir)); } }