From 72930e0be3a8841e8149b246542832128310c350 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 9 Mar 2008 12:17:55 +0000 Subject: 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 --- src/core/misc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/core/misc.c') 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 */ -- cgit v1.2.3