mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
Accept '@' in locale names.
2006-12-18 Matthias Clasen <mclasen@redhat.com> * glib/gkeyfile.c: Accept '@' in locale names.
This commit is contained in:
parent
6b52690bb5
commit
52ef9438ca
@ -1,5 +1,7 @@
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user