mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
core: make get/set object properties case sensitive (issue #1872)
This commit is contained in:
+19
-19
@@ -2106,17 +2106,17 @@ config_file_option_get_string (struct t_config_option *option,
|
||||
if (!option || !property)
|
||||
return NULL;
|
||||
|
||||
if (string_strcasecmp (property, "config_name") == 0)
|
||||
if (string_strcmp (property, "config_name") == 0)
|
||||
return option->config_file->name;
|
||||
else if (string_strcasecmp (property, "section_name") == 0)
|
||||
else if (string_strcmp (property, "section_name") == 0)
|
||||
return option->section->name;
|
||||
else if (string_strcasecmp (property, "name") == 0)
|
||||
else if (string_strcmp (property, "name") == 0)
|
||||
return option->name;
|
||||
else if (string_strcasecmp (property, "parent_name") == 0)
|
||||
else if (string_strcmp (property, "parent_name") == 0)
|
||||
return option->parent_name;
|
||||
else if (string_strcasecmp (property, "type") == 0)
|
||||
else if (string_strcmp (property, "type") == 0)
|
||||
return config_option_type_string[option->type];
|
||||
else if (string_strcasecmp (property, "description") == 0)
|
||||
else if (string_strcmp (property, "description") == 0)
|
||||
return option->description;
|
||||
|
||||
return NULL;
|
||||
@@ -2133,31 +2133,31 @@ config_file_option_get_pointer (struct t_config_option *option,
|
||||
if (!option || !property)
|
||||
return NULL;
|
||||
|
||||
if (string_strcasecmp (property, "config_file") == 0)
|
||||
if (string_strcmp (property, "config_file") == 0)
|
||||
return option->config_file;
|
||||
else if (string_strcasecmp (property, "section") == 0)
|
||||
else if (string_strcmp (property, "section") == 0)
|
||||
return option->section;
|
||||
else if (string_strcasecmp (property, "name") == 0)
|
||||
else if (string_strcmp (property, "name") == 0)
|
||||
return option->name;
|
||||
else if (string_strcasecmp (property, "parent_name") == 0)
|
||||
else if (string_strcmp (property, "parent_name") == 0)
|
||||
return option->parent_name;
|
||||
else if (string_strcasecmp (property, "type") == 0)
|
||||
else if (string_strcmp (property, "type") == 0)
|
||||
return &option->type;
|
||||
else if (string_strcasecmp (property, "description") == 0)
|
||||
else if (string_strcmp (property, "description") == 0)
|
||||
return option->description;
|
||||
else if (string_strcasecmp (property, "string_values") == 0)
|
||||
else if (string_strcmp (property, "string_values") == 0)
|
||||
return option->string_values;
|
||||
else if (string_strcasecmp (property, "min") == 0)
|
||||
else if (string_strcmp (property, "min") == 0)
|
||||
return &option->min;
|
||||
else if (string_strcasecmp (property, "max") == 0)
|
||||
else if (string_strcmp (property, "max") == 0)
|
||||
return &option->max;
|
||||
else if (string_strcasecmp (property, "default_value") == 0)
|
||||
else if (string_strcmp (property, "default_value") == 0)
|
||||
return option->default_value;
|
||||
else if (string_strcasecmp (property, "value") == 0)
|
||||
else if (string_strcmp (property, "value") == 0)
|
||||
return option->value;
|
||||
else if (string_strcasecmp (property, "prev_option") == 0)
|
||||
else if (string_strcmp (property, "prev_option") == 0)
|
||||
return option->prev_option;
|
||||
else if (string_strcasecmp (property, "next_option") == 0)
|
||||
else if (string_strcmp (property, "next_option") == 0)
|
||||
return option->next_option;
|
||||
|
||||
return NULL;
|
||||
|
||||
+11
-11
@@ -749,9 +749,9 @@ hashtable_get_integer (struct t_hashtable *hashtable, const char *property)
|
||||
{
|
||||
if (hashtable && property)
|
||||
{
|
||||
if (string_strcasecmp (property, "size") == 0)
|
||||
if (string_strcmp (property, "size") == 0)
|
||||
return hashtable->size;
|
||||
else if (string_strcasecmp (property, "items_count") == 0)
|
||||
else if (string_strcmp (property, "items_count") == 0)
|
||||
return hashtable->items_count;
|
||||
}
|
||||
|
||||
@@ -1005,19 +1005,19 @@ hashtable_get_string (struct t_hashtable *hashtable, const char *property)
|
||||
{
|
||||
if (hashtable && property)
|
||||
{
|
||||
if (string_strcasecmp (property, "type_keys") == 0)
|
||||
if (string_strcmp (property, "type_keys") == 0)
|
||||
return hashtable_type_string[hashtable->type_keys];
|
||||
else if (string_strcasecmp (property, "type_values") == 0)
|
||||
else if (string_strcmp (property, "type_values") == 0)
|
||||
return hashtable_type_string[hashtable->type_values];
|
||||
else if (string_strcasecmp (property, "keys") == 0)
|
||||
else if (string_strcmp (property, "keys") == 0)
|
||||
return hashtable_get_keys_values (hashtable, 1, 0, 0);
|
||||
else if (string_strcasecmp (property, "keys_sorted") == 0)
|
||||
else if (string_strcmp (property, "keys_sorted") == 0)
|
||||
return hashtable_get_keys_values (hashtable, 1, 1, 0);
|
||||
else if (string_strcasecmp (property, "values") == 0)
|
||||
else if (string_strcmp (property, "values") == 0)
|
||||
return hashtable_get_keys_values (hashtable, 0, 0, 1);
|
||||
else if (string_strcasecmp (property, "keys_values") == 0)
|
||||
else if (string_strcmp (property, "keys_values") == 0)
|
||||
return hashtable_get_keys_values (hashtable, 1, 0, 1);
|
||||
else if (string_strcasecmp (property, "keys_values_sorted") == 0)
|
||||
else if (string_strcmp (property, "keys_values_sorted") == 0)
|
||||
return hashtable_get_keys_values (hashtable, 1, 1, 1);
|
||||
}
|
||||
|
||||
@@ -1034,9 +1034,9 @@ hashtable_set_pointer (struct t_hashtable *hashtable, const char *property,
|
||||
{
|
||||
if (hashtable && property)
|
||||
{
|
||||
if (string_strcasecmp (property, "callback_free_key") == 0)
|
||||
if (string_strcmp (property, "callback_free_key") == 0)
|
||||
hashtable->callback_free_key = pointer;
|
||||
else if (string_strcasecmp (property, "callback_free_value") == 0)
|
||||
else if (string_strcmp (property, "callback_free_value") == 0)
|
||||
hashtable->callback_free_value = pointer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1207,21 +1207,21 @@ hdata_get_string (struct t_hdata *hdata, const char *property)
|
||||
if (!hdata || !property)
|
||||
return NULL;
|
||||
|
||||
if (string_strcasecmp (property, "var_keys") == 0)
|
||||
if (string_strcmp (property, "var_keys") == 0)
|
||||
return hashtable_get_string (hdata->hash_var, "keys");
|
||||
else if (string_strcasecmp (property, "var_values") == 0)
|
||||
else if (string_strcmp (property, "var_values") == 0)
|
||||
return hashtable_get_string (hdata->hash_var, "values");
|
||||
else if (string_strcasecmp (property, "var_keys_values") == 0)
|
||||
else if (string_strcmp (property, "var_keys_values") == 0)
|
||||
return hashtable_get_string (hdata->hash_var, "keys_values");
|
||||
else if (string_strcasecmp (property, "var_prev") == 0)
|
||||
else if (string_strcmp (property, "var_prev") == 0)
|
||||
return hdata->var_prev;
|
||||
else if (string_strcasecmp (property, "var_next") == 0)
|
||||
else if (string_strcmp (property, "var_next") == 0)
|
||||
return hdata->var_next;
|
||||
else if (string_strcasecmp (property, "list_keys") == 0)
|
||||
else if (string_strcmp (property, "list_keys") == 0)
|
||||
return hashtable_get_string (hdata->hash_list, "keys");
|
||||
else if (string_strcasecmp (property, "list_values") == 0)
|
||||
else if (string_strcmp (property, "list_values") == 0)
|
||||
return hashtable_get_string (hdata->hash_list, "values");
|
||||
else if (string_strcasecmp (property, "list_keys_values") == 0)
|
||||
else if (string_strcmp (property, "list_keys_values") == 0)
|
||||
return hashtable_get_string (hdata->hash_list, "keys_values");
|
||||
|
||||
return NULL;
|
||||
|
||||
+4
-4
@@ -454,13 +454,13 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
|
||||
if (!hook_valid (hook))
|
||||
return;
|
||||
|
||||
if (string_strcasecmp (property, "subplugin") == 0)
|
||||
if (string_strcmp (property, "subplugin") == 0)
|
||||
{
|
||||
if (hook->subplugin)
|
||||
free (hook->subplugin);
|
||||
hook->subplugin = strdup (value);
|
||||
}
|
||||
else if (string_strcasecmp (property, "stdin") == 0)
|
||||
else if (string_strcmp (property, "stdin") == 0)
|
||||
{
|
||||
if (!hook->deleted
|
||||
&& (hook->type == HOOK_TYPE_PROCESS)
|
||||
@@ -472,7 +472,7 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
|
||||
(void) num_written;
|
||||
}
|
||||
}
|
||||
else if (string_strcasecmp (property, "stdin_close") == 0)
|
||||
else if (string_strcmp (property, "stdin_close") == 0)
|
||||
{
|
||||
if (!hook->deleted
|
||||
&& (hook->type == HOOK_TYPE_PROCESS)
|
||||
@@ -483,7 +483,7 @@ hook_set (struct t_hook *hook, const char *property, const char *value)
|
||||
HOOK_PROCESS(hook, child_write[HOOK_PROCESS_STDIN]) = -1;
|
||||
}
|
||||
}
|
||||
else if (string_strcasecmp (property, "signal") == 0)
|
||||
else if (string_strcmp (property, "signal") == 0)
|
||||
{
|
||||
if (!hook->deleted
|
||||
&& (hook->type == HOOK_TYPE_PROCESS)
|
||||
|
||||
@@ -203,37 +203,37 @@ proxy_set (struct t_proxy *proxy, const char *property, const char *value)
|
||||
if (!proxy || !property || !value)
|
||||
return 0;
|
||||
|
||||
if (string_strcasecmp (property, "name") == 0)
|
||||
if (string_strcmp (property, "name") == 0)
|
||||
{
|
||||
proxy_set_name (proxy, value);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "type") == 0)
|
||||
else if (string_strcmp (property, "type") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_TYPE], value, 1);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "ipv6") == 0)
|
||||
else if (string_strcmp (property, "ipv6") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_IPV6], value, 1);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "address") == 0)
|
||||
else if (string_strcmp (property, "address") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_ADDRESS], value, 1);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "port") == 0)
|
||||
else if (string_strcmp (property, "port") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_PORT], value, 1);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "username") == 0)
|
||||
else if (string_strcmp (property, "username") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_USERNAME], value, 1);
|
||||
return 1;
|
||||
}
|
||||
else if (string_strcasecmp (property, "password") == 0)
|
||||
else if (string_strcmp (property, "password") == 0)
|
||||
{
|
||||
config_file_option_set (proxy->options[PROXY_OPTION_PASSWORD], value, 1);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user