Add ircstrlower() function.
authorMichael Poole <mdpoole@troilus.org>
Sun, 15 Jun 2008 13:21:53 +0000 (09:21 -0400)
committerMichael Poole <mdpoole@troilus.org>
Sun, 15 Jun 2008 13:21:53 +0000 (09:21 -0400)
src/common.h
src/tools.c

index 37f8f4be340f65ff7f956f20e1a63f65629e9489..67be61122581a625ca9b06515c28d9e18900b707 100644 (file)
@@ -250,6 +250,7 @@ void tools_cleanup(void);
 int irccasecmp(const char *stra, const char *strb);
 int ircncasecmp(const char *stra, const char *strb, unsigned int len);
 const char *irccasestr(const char *haystack, const char *needle);
+char *ircstrlower(char *str);
 
 DECLARE_LIST(string_buffer, char);
 void string_buffer_append_string(struct string_buffer *buf, const char *tail);
index 8f0c2998cfe8cb719212a6a577c6a7370a30f0ec..10fb8d0fbec2ddcd986e343b6847f40953aa21ff 100644 (file)
@@ -385,6 +385,14 @@ irccasestr(const char *haystack, const char *needle) {
     return NULL;
 }
 
+char *
+ircstrlower(char *str) {
+    size_t ii;
+    for (ii = 0; str[ii] != '\0'; ++ii)
+        str[ii] = tolower(str[ii]);
+    return str;
+}
+
 int
 split_line(char *line, int irc_colon, int argv_size, char *argv[])
 {