X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Fcommon.c;h=4916b3ca0cb0b507038a22dc3bfb7613c301339a;hp=2b6b5eb9180efa2272695de031d0d3d4c6d49ac0;hb=96c41b0aed8e2b9f6a5fa70dbba77465a2da4173;hpb=5168f69eefd02bd6cfd4060cff4f4862f5a2a66c diff --git a/src/common.c b/src/common.c index 2b6b5eb..4916b3c 100644 --- a/src/common.c +++ b/src/common.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -190,4 +191,25 @@ int print_debug (const char *format, ...) /* {{{ */ return (status); } /* }}} int print_debug */ +char *strtolower (char *str) /* {{{ */ +{ + unsigned int i; + + if (str == NULL) + return (NULL); + + for (i = 0; str[i] != 0; i++) + str[i] = (char) tolower ((int) str[i]); + + return (str); +} /* }}} char *strtolower */ + +char *strtolower_copy (const char *str) +{ + if (str == NULL) + return (NULL); + + return (strdup (str)); +} + /* vim: set sw=2 sts=2 et fdm=marker : */