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-common/core | |
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-common/core')
-rw-r--r-- | src/fe-common/core/fe-exec.c | 12 | ||||
-rw-r--r-- | src/fe-common/core/fe-log.c | 6 | ||||
-rw-r--r-- | src/fe-common/core/fe-settings.c | 6 | ||||
-rw-r--r-- | src/fe-common/core/printtext.c | 4 | ||||
-rw-r--r-- | src/fe-common/core/themes.c | 2 | ||||
-rw-r--r-- | src/fe-common/core/window-commands.c | 12 | ||||
-rw-r--r-- | src/fe-common/core/windows-layout.c | 4 |
7 files changed, 23 insertions, 23 deletions
diff --git a/src/fe-common/core/fe-exec.c b/src/fe-common/core/fe-exec.c index 754182cf..5740855d 100644 --- a/src/fe-common/core/fe-exec.c +++ b/src/fe-common/core/fe-exec.c @@ -209,17 +209,17 @@ static int signal_name_to_id(const char *name) /* check only the few most common signals, too much job to check them all. if we sometimes want more, procps-sources/proc/sig.c would be useful for copypasting */ - if (g_strcasecmp(name, "hup") == 0) + if (g_ascii_strcasecmp(name, "hup") == 0) return SIGHUP; - if (g_strcasecmp(name, "int") == 0) + if (g_ascii_strcasecmp(name, "int") == 0) return SIGINT; - if (g_strcasecmp(name, "term") == 0) + if (g_ascii_strcasecmp(name, "term") == 0) return SIGTERM; - if (g_strcasecmp(name, "kill") == 0) + if (g_ascii_strcasecmp(name, "kill") == 0) return SIGKILL; - if (g_strcasecmp(name, "usr1") == 0) + if (g_ascii_strcasecmp(name, "usr1") == 0) return SIGUSR1; - if (g_strcasecmp(name, "usr2") == 0) + if (g_ascii_strcasecmp(name, "usr2") == 0) return SIGUSR2; return -1; } diff --git a/src/fe-common/core/fe-log.c b/src/fe-common/core/fe-log.c index 92df39ed..61b7a316 100644 --- a/src/fe-common/core/fe-log.c +++ b/src/fe-common/core/fe-log.c @@ -279,11 +279,11 @@ static void cmd_window_log(const char *data) log = logs_find_item(LOG_ITEM_WINDOW_REFNUM, window, NULL, NULL); open_log = close_log = FALSE; - if (g_strcasecmp(set, "ON") == 0) + if (g_ascii_strcasecmp(set, "ON") == 0) open_log = TRUE; - else if (g_strcasecmp(set, "OFF") == 0) { + else if (g_ascii_strcasecmp(set, "OFF") == 0) { close_log = TRUE; - } else if (g_strcasecmp(set, "TOGGLE") == 0) { + } else if (g_ascii_strcasecmp(set, "TOGGLE") == 0) { open_log = log == NULL; close_log = log != NULL; } else { diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c index a2881630..45cff2ba 100644 --- a/src/fe-common/core/fe-settings.c +++ b/src/fe-common/core/fe-settings.c @@ -66,11 +66,11 @@ static void set_print_pattern(const char *pattern) static void set_boolean(const char *key, const char *value) { - if (g_strcasecmp(value, "ON") == 0) + if (g_ascii_strcasecmp(value, "ON") == 0) settings_set_bool(key, TRUE); - else if (g_strcasecmp(value, "OFF") == 0) + else if (g_ascii_strcasecmp(value, "OFF") == 0) settings_set_bool(key, FALSE); - else if (g_strcasecmp(value, "TOGGLE") == 0) + else if (g_ascii_strcasecmp(value, "TOGGLE") == 0) settings_set_bool(key, !settings_get_bool(key)); else printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_NOT_TOGGLE); diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c index e985131f..0e409ecd 100644 --- a/src/fe-common/core/printtext.c +++ b/src/fe-common/core/printtext.c @@ -462,9 +462,9 @@ static void sig_gui_dialog(const char *type, const char *text) { char *format; - if (g_strcasecmp(type, "warning") == 0) + if (g_ascii_strcasecmp(type, "warning") == 0) format = "%_Warning:%_ %s"; - else if (g_strcasecmp(type, "error") == 0) + else if (g_ascii_strcasecmp(type, "error") == 0) format = "%_Error:%_ %s"; else format = "%s"; diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c index 99803be8..b2a59584 100644 --- a/src/fe-common/core/themes.c +++ b/src/fe-common/core/themes.c @@ -1144,7 +1144,7 @@ static void theme_save(THEME_REC *theme, int save_all) if (config != NULL) config_parse(config); else { - if (g_strcasecmp(theme->name, "default") == 0) { + if (g_ascii_strcasecmp(theme->name, "default") == 0) { config = config_open(NULL, -1); config_parse_data(config, default_theme, "internal"); config_change_file_name(config, theme->path, 0660); diff --git a/src/fe-common/core/window-commands.c b/src/fe-common/core/window-commands.c index c67fa1cc..ecc4f285 100644 --- a/src/fe-common/core/window-commands.c +++ b/src/fe-common/core/window-commands.c @@ -175,8 +175,8 @@ static void cmd_window_new(const char *data, void *server, WI_ITEM_REC *item) g_return_if_fail(data != NULL); - type = (g_strncasecmp(data, "hid", 3) == 0 || g_strcasecmp(data, "tab") == 0) ? 1 : - (g_strcasecmp(data, "split") == 0 ? 2 : 0); + type = (g_ascii_strncasecmp(data, "hid", 3) == 0 || g_ascii_strcasecmp(data, "tab") == 0) ? 1 : + (g_ascii_strcasecmp(data, "split") == 0 ? 2 : 0); signal_emit("gui window create override", 1, GINT_TO_POINTER(type)); window = window_create(NULL, FALSE); @@ -335,7 +335,7 @@ static void cmd_window_goto(const char *data) if (!cmd_get_params(data, &free_arg, 1, &target)) return; - if (g_strcasecmp(target, "active") == 0) + if (g_ascii_strcasecmp(target, "active") == 0) window = window_highest_activity(active_win); else { window = window_find_name(target); @@ -403,11 +403,11 @@ static void cmd_window_immortal(const char *data) if (*data == '\0') set = active_win->immortal; - else if (g_strcasecmp(data, "ON") == 0) + else if (g_ascii_strcasecmp(data, "ON") == 0) set = TRUE; - else if (g_strcasecmp(data, "OFF") == 0) + else if (g_ascii_strcasecmp(data, "OFF") == 0) set = FALSE; - else if (g_strcasecmp(data, "TOGGLE") == 0) + else if (g_ascii_strcasecmp(data, "TOGGLE") == 0) set = !active_win->immortal; else { printformat_window(active_win, MSGLEVEL_CLIENTERROR, diff --git a/src/fe-common/core/windows-layout.c b/src/fe-common/core/windows-layout.c index 9285f3bd..882e8539 100644 --- a/src/fe-common/core/windows-layout.c +++ b/src/fe-common/core/windows-layout.c @@ -57,11 +57,11 @@ static void sig_layout_restore_item(WINDOW_REC *window, const char *type, if (name == NULL || tag == NULL) return; - if (g_strcasecmp(type, "CHANNEL") == 0) { + if (g_ascii_strcasecmp(type, "CHANNEL") == 0) { /* bind channel to window */ WINDOW_BIND_REC *rec = window_bind_add(window, tag, name); rec->sticky = TRUE; - } else if (g_strcasecmp(type, "QUERY") == 0 && chat_type != NULL) { + } else if (g_ascii_strcasecmp(type, "QUERY") == 0 && chat_type != NULL) { CHAT_PROTOCOL_REC *protocol; /* create query immediately */ signal_add("query created", |