summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-05-17 15:09:30 +0300
committerVicent Marti <tanoku@gmail.com>2011-05-17 15:11:19 +0300
commit0da2c70067135ffb095f951b30cb085db1aeccce (patch)
treead3390ce18ea85d7300e8474268a0ac028f2187f /src/util.c
parent128d37316b7499c70c2d8b44635253541647f583 (diff)
downloadlibgit2-0da2c70067135ffb095f951b30cb085db1aeccce.tar.gz
utils: Move git__str[n]tolower
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 55a7ab2a9..9499ceadf 100644
--- a/src/util.c
+++ b/src/util.c
@@ -104,6 +104,20 @@ int git__fmt(char *buf, size_t buf_sz, const char *fmt, ...)
return r;
}
+void git__strntolower(char *str, int len)
+{
+ int i;
+
+ for (i = 0; i < len; ++i) {
+ str[i] = tolower(str[i]);
+ }
+}
+
+void git__strtolower(char *str)
+{
+ git__strntolower(str, strlen(str));
+}
+
int git__prefixcmp(const char *str, const char *prefix)
{
for (;;) {