From 745259b1c216d49989d412329d823a02de4e0e8a Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sun, 15 Jun 2008 09:21:53 -0400 Subject: [PATCH] Add ircstrlower() function. --- src/common.h | 1 + src/tools.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/common.h b/src/common.h index 37f8f4b..67be611 100644 --- a/src/common.h +++ b/src/common.h @@ -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); diff --git a/src/tools.c b/src/tools.c index 8f0c299..10fb8d0 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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[]) { -- 2.20.1