@@ -157,20 +157,6 @@ enchant_get_conf_dirs (void)
157
157
/********************************************************************************/
158
158
/********************************************************************************/
159
159
160
- /* returns TRUE if tag is valid
161
- * for requires alphanumeric ASCII or underscore
162
- */
163
- static G_GNUC_PURE int
164
- enchant_is_valid_dictionary_tag (const char * const tag )
165
- {
166
- const char * it ;
167
- for (it = tag ; * it ; ++ it )
168
- if (!g_ascii_isalnum (* it ) && * it != '_' )
169
- return 0 ;
170
-
171
- return it != tag ; /*empty tag invalid*/
172
- }
173
-
174
160
static char *
175
161
enchant_normalize_dictionary_tag (const char * const dict_tag )
176
162
{
@@ -1015,9 +1001,7 @@ enchant_broker_request_dict_with_pwl (EnchantBroker * broker, const char *const
1015
1001
enchant_broker_clear_error (broker );
1016
1002
1017
1003
char * normalized_tag = enchant_normalize_dictionary_tag (tag );
1018
- if (!enchant_is_valid_dictionary_tag (normalized_tag ))
1019
- enchant_broker_set_error (broker , "invalid tag character found" );
1020
- else if ((dict = _enchant_broker_request_dict (broker , normalized_tag , pwl )) == NULL )
1004
+ if ((dict = _enchant_broker_request_dict (broker , normalized_tag , pwl )) == NULL )
1021
1005
{
1022
1006
char * iso_639_only_tag = enchant_iso_639_from_tag (normalized_tag );
1023
1007
if (iso_639_only_tag == NULL ) {
@@ -1088,20 +1072,18 @@ enchant_broker_list_dicts (EnchantBroker * broker, EnchantDictDescribeFn fn, voi
1088
1072
{
1089
1073
const char * tag = dicts [i ];
1090
1074
g_debug ("tag %s" , tag );
1091
- if (enchant_is_valid_dictionary_tag (tag )) {
1092
- GSList * providers = enchant_get_ordered_providers (broker , tag );
1093
- gint this_priority = g_slist_index (providers , provider );
1094
- g_debug ("priority %d" , this_priority );
1095
- if (this_priority != -1 ) {
1096
- gint min_priority = this_priority + 1 ;
1097
- gpointer ptr = g_hash_table_lookup (tag_map , tag );
1098
- if (ptr != NULL )
1099
- min_priority = g_slist_index (providers , ptr );
1100
- if (this_priority < min_priority )
1101
- g_hash_table_insert (tag_map , strdup (tag ), provider );
1102
- }
1103
- g_slist_free (providers );
1075
+ GSList * providers = enchant_get_ordered_providers (broker , tag );
1076
+ gint this_priority = g_slist_index (providers , provider );
1077
+ g_debug ("priority %d" , this_priority );
1078
+ if (this_priority != -1 ) {
1079
+ gint min_priority = this_priority + 1 ;
1080
+ gpointer ptr = g_hash_table_lookup (tag_map , tag );
1081
+ if (ptr != NULL )
1082
+ min_priority = g_slist_index (providers , ptr );
1083
+ if (this_priority < min_priority )
1084
+ g_hash_table_insert (tag_map , strdup (tag ), provider );
1104
1085
}
1086
+ g_slist_free (providers );
1105
1087
}
1106
1088
1107
1089
g_strfreev (dicts );
@@ -1203,9 +1185,7 @@ enchant_broker_dict_exists (EnchantBroker * broker, const char * const tag)
1203
1185
char * normalized_tag = enchant_normalize_dictionary_tag (tag );
1204
1186
int exists = 0 ;
1205
1187
1206
- if (!enchant_is_valid_dictionary_tag (normalized_tag ))
1207
- enchant_broker_set_error (broker , "invalid tag character found" );
1208
- else if ((exists = _enchant_broker_dict_exists (broker , normalized_tag )) == 0 )
1188
+ if ((exists = _enchant_broker_dict_exists (broker , normalized_tag )) == 0 )
1209
1189
{
1210
1190
char * iso_639_only_tag = enchant_iso_639_from_tag (normalized_tag );
1211
1191
if (iso_639_only_tag == NULL ) {
0 commit comments