Index: glib/gkeyfile.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gkeyfile.c,v
retrieving revision 1.43
diff -p -u -u -p -r1.43 gkeyfile.c
--- glib/gkeyfile.c	1 Jun 2006 04:51:25 -0000	1.43
+++ glib/gkeyfile.c	14 Jun 2006 13:17:40 -0000
@@ -940,6 +940,7 @@ g_key_file_to_data (GKeyFile  *key_file,
        group_node = group_node->prev)
     {
       GKeyFileGroup *group;
+      gint n_values = 0;
 
       group = (GKeyFileGroup *) group_node->data;
 
@@ -950,7 +951,7 @@ g_key_file_to_data (GKeyFile  *key_file,
 
       for (key_file_node = g_list_last (group->key_value_pairs);
            key_file_node != NULL;
-           key_file_node = key_file_node->prev)
+           key_file_node = key_file_node->prev, ++n_values)
         {
           GKeyFileKeyValuePair *pair;
 
@@ -961,6 +962,9 @@ g_key_file_to_data (GKeyFile  *key_file,
           else
             g_string_append_printf (data_string, "%s\n", pair->value);
         }
+
+	if (n_values > 0)
+	  g_string_append_c (data_string, '\n');
     }
 
   if (length)
