-diff -ruN gg-0.2.2.1.org/src/callbacks.c gg-0.2.2.1/src/callbacks.c
---- gg-0.2.2.1.org/src/callbacks.c Wed May 1 10:07:08 2002
-+++ gg-0.2.2.1/src/callbacks.c Wed May 29 13:06:14 2002
-@@ -407,9 +407,13 @@
- FILE *fp;
+diff -Nur gg-0.2.2.1.orig/src/callbacks.c gg-0.2.2.1/src/callbacks.c
+--- gg-0.2.2.1.orig/src/callbacks.c Wed May 1 10:07:08 2002
++++ gg-0.2.2.1/src/callbacks.c Wed May 29 13:43:33 2002
+@@ -408,7 +408,7 @@
gchar *path;
-- path =
+ path =
- g_strdup_printf("%s/.gg/history/%d", getenv("HOME"),
-- kontakt->uin);
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strdup_printf("%s/%s/gg/history/%d",
-+ getenv("HOME"), getenv("CONFIG_DIR"), kontakt->uin);
-+ else
-+ path = g_strdup_printf("%s/.gg/history/%d",
-+ getenv("HOME"), kontakt->uin);
-+
++ g_strdup_printf("%s/history/%d", config.homedir,
+ kontakt->uin);
fp = fopen(path, "r");
if (fp) {
- while (!feof(fp)) {
-diff -ruN gg-0.2.2.1.org/src/gg.c gg-0.2.2.1/src/gg.c
---- gg-0.2.2.1.org/src/gg.c Fri Apr 19 16:04:50 2002
-+++ gg-0.2.2.1/src/gg.c Wed May 29 13:03:55 2002
-@@ -407,12 +407,18 @@
+diff -Nur gg-0.2.2.1.orig/src/gg-types.h gg-0.2.2.1/src/gg-types.h
+--- gg-0.2.2.1.orig/src/gg-types.h Mon Apr 22 11:59:01 2002
++++ gg-0.2.2.1/src/gg-types.h Wed May 29 13:34:54 2002
+@@ -61,6 +61,7 @@
+ guint save_config_on_exit;
+ guint save_contacts_on_exit;
+ gchar *server;
++ gchar *homedir;
+ } GGConfig;
+
+ typedef struct {
+diff -Nur gg-0.2.2.1.orig/src/gg.c gg-0.2.2.1/src/gg.c
+--- gg-0.2.2.1.orig/src/gg.c Fri Apr 19 16:04:50 2002
++++ gg-0.2.2.1/src/gg.c Wed May 29 13:43:09 2002
+@@ -407,12 +407,12 @@
gchar *path, *timestamp, *lognick;
FILE *fp;
- path = g_strdup_printf("%s/.gg/history", getenv("HOME"));
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strdup_printf("%s/%s/gg/history", getenv("HOME"), getenv("CONFIG_DIR"));
-+ else
-+ path = g_strdup_printf("%s/.gg/history", getenv("HOME"));
-+
++ path = g_strdup_printf("%s/history", config.homedir);
mkdir(path, 0755);
g_free(path);
-- path =
+ path =
- g_strdup_printf("%s/.gg/history/%d", getenv("HOME"), sess_uin);
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strdup_printf("%s/%s/gg/history/%d", getenv("HOME"), getenv("CONFIG_DIR"), sess_uin);
-+ else
-+ path = g_strdup_printf("%s/.gg/history/%d", getenv("HOME"), sess_uin);
++ g_strdup_printf("%s/history/%d", config.homedir, sess_uin);
fp = fopen(path, "a");
g_free(path);
-diff -ruN gg-0.2.2.1.org/src/main.c gg-0.2.2.1/src/main.c
---- gg-0.2.2.1.org/src/main.c Mon Apr 22 11:59:01 2002
-+++ gg-0.2.2.1/src/main.c Wed May 29 13:19:44 2002
-@@ -80,7 +80,11 @@
+diff -Nur gg-0.2.2.1.orig/src/main.c gg-0.2.2.1/src/main.c
+--- gg-0.2.2.1.orig/src/main.c Mon Apr 22 11:59:01 2002
++++ gg-0.2.2.1/src/main.c Wed May 29 13:39:50 2002
+@@ -80,7 +80,7 @@
FILE *fp;
GList *tmplist;
- path = g_strconcat(g_get_home_dir(), "/.gg/userlist", NULL);
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strconcat(g_get_home_dir(), "/", getenv("CONFIG_DIR"),
-+ "/gg/userlist", NULL);
-+ else
-+ path = g_strconcat(g_get_home_dir(), "/.gg/userlist", NULL);
++ path = g_strconcat(config.homedir, "/userlist", NULL);
fp = fopen(path, "w");
-@@ -139,7 +143,10 @@
+@@ -139,7 +139,7 @@
}
gtk_clist_clear(GTK_CLIST(lista));
- path = g_strconcat(getenv("HOME"), "/.gg/userlist", NULL);
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strconcat(getenv("HOME"), "/", getenv("CONFIG_DIR"), "/gg/userlist", NULL);
-+ else
-+ path = g_strconcat(getenv("HOME"), "/.gg/userlist", NULL);
++ path = g_strconcat(config.homedir, "/userlist", NULL);
fp = fopen(path, "r");
-@@ -271,7 +278,11 @@
+@@ -271,7 +271,7 @@
config.save_contacts_on_exit = 1;
config.server = g_strdup(GG_DEFAULT_HOST);
- path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strconcat(getenv("HOME"), "/", getenv("CONFIG_DIR"),
-+ "/gg/config", NULL);
-+ else
-+ path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
++ path = g_strconcat(config.homedir, "/config", NULL);
g_list_free(ignore);
-@@ -431,7 +442,12 @@
+@@ -431,7 +431,7 @@
config.width=window->allocation.width;
config.height=window->allocation.height;
}
- path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
-+
-+ if (getenv("CONFIG_DIR"))
-+ path = g_strconcat(getenv("HOME"), "/", getenv("CONFIG_DIR"),
-+ "/gg/config", NULL);
-+ else
-+ path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
++ path = g_strconcat(config.homedir, "/config", NULL);
fp = fopen(path, "w");
-@@ -574,7 +590,11 @@
+@@ -572,12 +572,16 @@
+ #ifdef USE_APPLET
+ gchar applet_name[] = "gg";
#endif
- gchar *path = NULL;
+- gchar *path = NULL;
- path = g_strconcat(getenv("HOME"), "/.gg", NULL);
+- mkdir(path, 0755);
+- g_free(path);
++ config.homedir = NULL;
+ if (getenv("CONFIG_DIR"))
-+ path = g_strconcat(getenv("HOME"), "/", getenv("CONFIG_DIR"),
-+ "/gg", NULL);
++ config.homedir = g_strconcat(getenv("HOME"),
++ getenv("CONFIG_DIR"), "/gg", NULL);
+ else
-+ path = g_strconcat(getenv("HOME"), "/.gg", NULL);
- mkdir(path, 0755);
- g_free(path);
++ config.homedir = g_strconcat(getenv("HOME"), "/.gg", NULL);
++ mkdir(config.homedir, 0700);
++
+ read_config();
+
+ g_set_print_handler((GPrintFunc) my_g_print);
+@@ -649,5 +653,7 @@
+ gtk_main();
+ #endif
+
++ g_free(config.homedir);
++
+ return 0;
+ }