diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-03-09 12:01:16 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-03-09 12:01:16 +0000 |
commit | 7df46597e17ff7af4a660ab47673fe2cabc91db6 (patch) | |
tree | 2e2abd9c8e4de4e7311c0506119142f62a78a2f1 /src/fe-text | |
parent | 496d82ac4843b3dcf8fe64c216470f41f91120d9 (diff) | |
download | irssi-7df46597e17ff7af4a660ab47673fe2cabc91db6.zip |
Use g_ascii_str{,n}casecmp for case insensitive comparison with
ascii only strings.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4738 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/statusbar-config.c | 24 | ||||
-rw-r--r-- | src/fe-text/statusbar-items.c | 4 | ||||
-rw-r--r-- | src/fe-text/term.c | 4 | ||||
-rw-r--r-- | src/fe-text/textbuffer-commands.c | 6 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/fe-text/statusbar-config.c b/src/fe-text/statusbar-config.c index cbc9af52..491881d8 100644 --- a/src/fe-text/statusbar-config.c +++ b/src/fe-text/statusbar-config.c @@ -163,16 +163,16 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node) } visible_str = config_node_get_str(node, "visible", ""); - if (g_strcasecmp(visible_str, "active") == 0) + if (g_ascii_strcasecmp(visible_str, "active") == 0) bar->visible = STATUSBAR_VISIBLE_ACTIVE; - else if (g_strcasecmp(visible_str, "inactive") == 0) + else if (g_ascii_strcasecmp(visible_str, "inactive") == 0) bar->visible = STATUSBAR_VISIBLE_INACTIVE; else bar->visible = STATUSBAR_VISIBLE_ALWAYS; - if (g_strcasecmp(config_node_get_str(node, "type", ""), "window") == 0) + if (g_ascii_strcasecmp(config_node_get_str(node, "type", ""), "window") == 0) bar->type = STATUSBAR_TYPE_WINDOW; - if (g_strcasecmp(config_node_get_str(node, "placement", ""), "top") == 0) + if (g_ascii_strcasecmp(config_node_get_str(node, "placement", ""), "top") == 0) bar->placement = STATUSBAR_TOP; bar->position = config_node_get_int(node, "position", 0); @@ -378,9 +378,9 @@ static void cmd_statusbar_reset(const char *data, void *server, static void cmd_statusbar_type(const char *data, void *server, void *item, CONFIG_NODE *node) { - if (g_strcasecmp(data, "window") == 0) + if (g_ascii_strcasecmp(data, "window") == 0) iconfig_node_set_str(node, "type", "window"); - else if (g_strcasecmp(data, "root") == 0) + else if (g_ascii_strcasecmp(data, "root") == 0) iconfig_node_set_str(node, "type", "root"); else { printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, @@ -392,9 +392,9 @@ static void cmd_statusbar_type(const char *data, void *server, static void cmd_statusbar_placement(const char *data, void *server, void *item, CONFIG_NODE *node) { - if (g_strcasecmp(data, "top") == 0) + if (g_ascii_strcasecmp(data, "top") == 0) iconfig_node_set_str(node, "placement", "top"); - else if (g_strcasecmp(data, "bottom") == 0) + else if (g_ascii_strcasecmp(data, "bottom") == 0) iconfig_node_set_str(node, "placement", "bottom"); else { printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, @@ -413,11 +413,11 @@ static void cmd_statusbar_position(const char *data, void *server, static void cmd_statusbar_visible(const char *data, void *server, void *item, CONFIG_NODE *node) { - if (g_strcasecmp(data, "always") == 0) + if (g_ascii_strcasecmp(data, "always") == 0) iconfig_node_set_str(node, "visible", "always"); - else if (g_strcasecmp(data, "active") == 0) + else if (g_ascii_strcasecmp(data, "active") == 0) iconfig_node_set_str(node, "visible", "active"); - else if (g_strcasecmp(data, "inactive") == 0) + else if (g_ascii_strcasecmp(data, "inactive") == 0) iconfig_node_set_str(node, "visible", "inactive"); else { printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, @@ -495,7 +495,7 @@ static void cmd_statusbar_add(const char *data, void *server, value = g_hash_table_lookup(optlist, "alignment"); if (value != NULL) { iconfig_node_set_str(node, "alignment", - g_strcasecmp(value, "right") == 0 ? + g_ascii_strcasecmp(value, "right") == 0 ? "right" : NULL); } diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index 62a7d940..bf4e5b98 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -392,9 +392,9 @@ static void read_settings(void) gui_entry_set_utf8(active_entry, term_type == TERM_TYPE_UTF8); str = settings_get_str("actlist_sort"); - if (strcasecmp(str, "recent") == 0) + if (g_ascii_strcasecmp(str, "recent") == 0) actlist_sort = 1; - else if (strcasecmp(str, "level") == 0) + else if (g_ascii_strcasecmp(str, "level") == 0) actlist_sort = 2; else { settings_set_str("actlist_sort", "refnum"); diff --git a/src/fe-text/term.c b/src/fe-text/term.c index 692394b5..c5879c7a 100644 --- a/src/fe-text/term.c +++ b/src/fe-text/term.c @@ -120,9 +120,9 @@ static void read_settings(void) /* set terminal type */ str = settings_get_str("term_charset"); - if (g_strcasecmp(str, "utf-8") == 0) + if (g_ascii_strcasecmp(str, "utf-8") == 0) term_type = TERM_TYPE_UTF8; - else if (g_strcasecmp(str, "big5") == 0) + else if (g_ascii_strcasecmp(str, "big5") == 0) term_type = TERM_TYPE_BIG5; else term_type = TERM_TYPE_8BIT; diff --git a/src/fe-text/textbuffer-commands.c b/src/fe-text/textbuffer-commands.c index 4313cc2d..78d7e003 100644 --- a/src/fe-text/textbuffer-commands.c +++ b/src/fe-text/textbuffer-commands.c @@ -69,12 +69,12 @@ static void cmd_window_scroll(const char *data) GUI_WINDOW_REC *gui; gui = WINDOW_GUI(active_win); - if (g_strcasecmp(data, "default") == 0) { + if (g_ascii_strcasecmp(data, "default") == 0) { gui->use_scroll = FALSE; - } else if (g_strcasecmp(data, "on") == 0) { + } else if (g_ascii_strcasecmp(data, "on") == 0) { gui->use_scroll = TRUE; gui->scroll = TRUE; - } else if (g_strcasecmp(data, "off") == 0) { + } else if (g_ascii_strcasecmp(data, "off") == 0) { gui->use_scroll = TRUE; gui->scroll = FALSE; } else if (*data != '\0') { |