X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcommon.c;h=d6047c43ca75f64578c9fc60c4c3c06654be3af1;hb=8e72ccc76582cf1f68b6e9e4816ac0bd785fc7d8;hp=2b6b5eb9180efa2272695de031d0d3d4c6d49ac0;hpb=0ab3085f89e64eecd67d3179ea87f0463e918a10;p=collection4.git diff --git a/src/common.c b/src/common.c index 2b6b5eb..d6047c4 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 (strtolower (strdup (str))); +} + /* vim: set sw=2 sts=2 et fdm=marker : */