summary refs log tree commit diff stats
path: root/src/common/servlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/servlist.c')
-rw-r--r--src/common/servlist.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/common/servlist.c b/src/common/servlist.c
index f4208f61..96fa4557 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -1047,7 +1047,19 @@ servlist_load (void)
 	char *tmp;
 	ircnet *net = NULL;
 
-	fp = hexchat_fopen_file ("servlist_.conf", "r", 0);
+	/* 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);
+
+	fp = hexchat_fopen_file ("servlist.conf", "r", 0);
 	if (!fp)
 		return FALSE;
 
@@ -1178,12 +1190,12 @@ servlist_save (void)
 #ifndef WIN32
 	int first = FALSE;
 
-	buf = g_strdup_printf ("%s/servlist_.conf", get_xdir ());
+	buf = g_strdup_printf ("%s/servlist.conf", get_xdir ());
 	if (g_access (buf, F_OK) != 0)
 		first = TRUE;
 #endif
 
-	fp = hexchat_fopen_file ("servlist_.conf", "w", 0);
+	fp = hexchat_fopen_file ("servlist.conf", "w", 0);
 	if (!fp)
 	{
 #ifndef WIN32