Commit 52ef9438 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Accept '@' in locale names.

2006-12-18  Matthias Clasen  <mclasen@redhat.com>

        * glib/gkeyfile.c: Accept '@' in locale names.
parent 6b52690b
2006-12-18 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c: Accept '@' in locale names.
* glib/gkeyfile.c: Tighten up the check for allowed
key and group names. (#343191, Tommi Komulainen)
......
......@@ -3240,7 +3240,7 @@ g_key_file_is_key_name (const gchar *name)
if (*q == '[')
{
q++;
while (*q && (g_unichar_isalnum (g_utf8_get_char (q)) || *q == '-' || *q == '_' || *q == '.'))
while (*q && (g_unichar_isalnum (g_utf8_get_char (q)) || *q == '-' || *q == '_' || *q == '.' || *q == '@'))
q = g_utf8_next_char (q);
if (*q != ']')
......
......@@ -755,7 +755,8 @@ test_locale_string (void)
"key1[de_DE]=v1-de_DE\n"
"key1[de_DE.UTF8]=v1-de_DE.UTF8\n"
"key1[fr]=v1-fr\n"
"key1[en] =v1-en\n";
"key1[en] =v1-en\n"
"key1[sr@Latn]=v1-sr\n";
keyfile = load_data (data, G_KEY_FILE_KEEP_TRANSLATIONS);
......@@ -766,6 +767,7 @@ test_locale_string (void)
check_locale_string_value (keyfile, "valid", "key1", "fr", "v1-fr");
check_locale_string_value (keyfile, "valid", "key1", "fr_FR", "v1-fr");
check_locale_string_value (keyfile, "valid", "key1", "en", "v1-en");
check_locale_string_value (keyfile, "valid", "key1", "sr@Latn", "v1-sr");
g_key_file_free (keyfile);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment