summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorTingPing <tngpng@gmail.com>2013-03-23 17:15:27 -0300
committerTingPing <tngpng@gmail.com>2013-03-23 17:15:27 -0300
commitc99e7f8154326a1106c0faffe412097e3dfd663f (patch)
tree38bed6852d86b0ba237746b5be3ce3e84d049e81 /src
parentc38e8fdd142763eea1e126b4cd97b191bccef8f1 (diff)
Add migration code for servlist
Diffstat (limited to 'src')
-rw-r--r--src/common/servlist.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/servlist.c b/src/common/servlist.c
index 6dbc8f6e..e897b7c3 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -1046,6 +1046,17 @@ servlist_load (void)
 	int len;
 	char *tmp;
 	ircnet *net = NULL;
+	
+#ifndef G_OS_WIN32 /* simple migration we will keep for a short while */
+	char *oldfile = g_build_filename(get_xdir(), "servlist_.conf", NULL);
+	char *newfile = g_build_filename(get_xdir(), "servlist.conf", NULL);
+
+	if (g_file_test(oldfile, G_FILE_TEST_EXISTS) && !g_file_test(newfile, G_FILE_TEST_EXISTS))
+		g_rename (oldfile, newfile);
+
+	g_free (oldfile);
+	g_free (newfile);
+#endif
 
 	fp = hexchat_fopen_file ("servlist.conf", "r", 0);
 	if (!fp)