diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-03-09 12:17:55 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-03-09 12:17:55 +0000 |
commit | 72930e0be3a8841e8149b246542832128310c350 (patch) | |
tree | c4cb68d6557440d1144126dac6f8bacbfb72a191 /src/core | |
parent | 7df46597e17ff7af4a660ab47673fe2cabc91db6 (diff) | |
download | irssi-72930e0be3a8841e8149b246542832128310c350.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@4739 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/misc.c | 28 | ||||
-rw-r--r-- | src/core/servers-reconnect.c | 4 | ||||
-rw-r--r-- | src/core/servers.c | 4 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/core/misc.c b/src/core/misc.c index 0c404363..b97d2fa6 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -836,24 +836,24 @@ int parse_time_interval(const char *time, int *msecs) return TRUE; } - if (g_strncasecmp(desc, "days", len) == 0) { + if (g_ascii_strncasecmp(desc, "days", len) == 0) { if (number > 24) { /* would overflow */ return FALSE; } *msecs += number * 1000*3600*24; - } else if (g_strncasecmp(desc, "hours", len) == 0) + } else if (g_ascii_strncasecmp(desc, "hours", len) == 0) *msecs += number * 1000*3600; - else if (g_strncasecmp(desc, "minutes", len) == 0 || - g_strncasecmp(desc, "mins", len) == 0) + else if (g_ascii_strncasecmp(desc, "minutes", len) == 0 || + g_ascii_strncasecmp(desc, "mins", len) == 0) *msecs += number * 1000*60; - else if (g_strncasecmp(desc, "seconds", len) == 0 || - g_strncasecmp(desc, "secs", len) == 0) + else if (g_ascii_strncasecmp(desc, "seconds", len) == 0 || + g_ascii_strncasecmp(desc, "secs", len) == 0) *msecs += number * 1000; - else if (g_strncasecmp(desc, "milliseconds", len) == 0 || - g_strncasecmp(desc, "millisecs", len) == 0 || - g_strncasecmp(desc, "mseconds", len) == 0 || - g_strncasecmp(desc, "msecs", len) == 0) + else if (g_ascii_strncasecmp(desc, "milliseconds", len) == 0 || + g_ascii_strncasecmp(desc, "millisecs", len) == 0 || + g_ascii_strncasecmp(desc, "mseconds", len) == 0 || + g_ascii_strncasecmp(desc, "msecs", len) == 0) *msecs += number; else { ret = FALSE; @@ -907,13 +907,13 @@ int parse_size(const char *size, int *bytes) return FALSE; } - if (g_strncasecmp(desc, "gbytes", len) == 0) + if (g_ascii_strncasecmp(desc, "gbytes", len) == 0) *bytes += number * 1024*1024*1024; - if (g_strncasecmp(desc, "mbytes", len) == 0) + if (g_ascii_strncasecmp(desc, "mbytes", len) == 0) *bytes += number * 1024*1024; - if (g_strncasecmp(desc, "kbytes", len) == 0) + if (g_ascii_strncasecmp(desc, "kbytes", len) == 0) *bytes += number * 1024; - if (g_strncasecmp(desc, "bytes", len) == 0) + if (g_ascii_strncasecmp(desc, "bytes", len) == 0) *bytes += number; /* skip punctuation */ diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c index 2b227ebe..ae1942af 100644 --- a/src/core/servers-reconnect.c +++ b/src/core/servers-reconnect.c @@ -415,7 +415,7 @@ static void cmd_reconnect(const char *data, SERVER_REC *server) cmd_param_error(CMDERR_NOT_CONNECTED); rec = reconnects->data; } else { - if (g_strncasecmp(data, "RECON-", 6) == 0) + if (g_ascii_strncasecmp(data, "RECON-", 6) == 0) data += 6; tagnum = atoi(tag); @@ -439,7 +439,7 @@ static void cmd_disconnect(const char *data, SERVER_REC *server) { RECONNECT_REC *rec; - if (g_strncasecmp(data, "RECON-", 6) != 0) + if (g_ascii_strncasecmp(data, "RECON-", 6) != 0) return; /* handle only reconnection removing */ rec = reconnect_find_tag(atoi(data+6)); diff --git a/src/core/servers.c b/src/core/servers.c index 2e9d11fc..9b9e8263 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -77,8 +77,8 @@ static char *server_create_address_tag(const char *address) /* try to generate a reasonable server tag */ if (strchr(address, '.') == NULL) { start = end = NULL; - } else if (g_strncasecmp(address, "irc", 3) == 0 || - g_strncasecmp(address, "chat", 4) == 0) { + } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || + g_ascii_strncasecmp(address, "chat", 4) == 0) { /* irc-2.cs.hut.fi -> hut, chat.bt.net -> bt */ end = strrchr(address, '.'); start = end-1; |