broken pipe

This commit is contained in:
Matthias Clasen 2006-12-14 23:14:23 +00:00
parent c8c0251460
commit 2de47d13d3
3 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2006-12-14 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/keyfile.sgml: Clarify the behaviour
wrt. to duplicate keys and groups.
2006-10-01 Matthias Clasen <mclasen@redhat.com>
* === Released 2.12.4 ===

View File

@ -92,6 +92,14 @@ Key and Group names are case-sensitive, for example a group called
</itemizedlist>
</para>
<para>
Note that in contrast to the
<ulink url="http://freedesktop.org/Standards/desktop-entry-spec">Desktop
Entry Specification</ulink>, groups in key files may contain the same
key multiple times; the last entry wins. Key files may also contain
multiple groups with the same name; they are merged together.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>

View File

@ -1001,10 +1001,31 @@ test_duplicate_groups (void)
"key2=123\n";
keyfile = load_data (data, 0);
check_string_value (keyfile, "Desktop Entry", "key1", "123");
check_string_value (keyfile, "Desktop Entry", "key2", "123");
g_key_file_free (keyfile);
}
/* http://bugzilla.gnome.org/show_bug.cgi?id=385910 */
static void
test_duplicate_groups2 (void)
{
GKeyFile *keyfile;
const gchar *data =
"[A]\n"
"foo=bar\n"
"[B]\n"
"foo=baz\n"
"[A]\n"
"foo=bang\n";
keyfile = load_data (data, 0);
check_string_value (keyfile, "A", "foo", "bang");
check_string_value (keyfile, "B", "foo", "baz");
g_key_file_free (keyfile);
}
int
main (int argc, char *argv[])
@ -1023,6 +1044,7 @@ main (int argc, char *argv[])
test_groups ();
test_duplicate_keys ();
test_duplicate_groups ();
test_duplicate_groups2 ();
return 0;
}