From: Michael Poole Date: Sun, 15 Jun 2008 13:21:53 +0000 (-0400) Subject: Add ircstrlower() function. X-Git-Tag: v1.4.0-rc3~14 X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=745259b1c216d49989d412329d823a02de4e0e8a Add ircstrlower() function. --- 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[]) {