summaryrefslogtreecommitdiff
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
parent128d37316b7499c70c2d8b44635253541647f583 (diff)
downloadlibgit2-0da2c70067135ffb095f951b30cb085db1aeccce.tar.gz
utils: Move git__str[n]tolower
-rw-r--r--src/config.c14
-rw-r--r--src/config.h3
-rw-r--r--src/util.c14
-rw-r--r--src/util.h3
4 files changed, 17 insertions, 17 deletions
diff --git a/src/config.c b/src/config.c
index 234c5303f..cd0a73ccd 100644
--- a/src/config.c
+++ b/src/config.c
@@ -37,20 +37,6 @@ typedef struct {
int priority;
} backend_internal;
-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_config_open_bare(git_config **out, const char *path)
{
git_config_backend *backend = NULL;
diff --git a/src/config.h b/src/config.h
index e786e8a49..a811fd850 100644
--- a/src/config.h
+++ b/src/config.h
@@ -9,7 +9,4 @@ struct git_config {
git_vector backends;
};
-void git__strtolower(char *str);
-void git__strntolower(char *str, int len);
-
#endif
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 (;;) {
diff --git a/src/util.h b/src/util.h
index ff6e67f8d..e5a2ebe5f 100644
--- a/src/util.h
+++ b/src/util.h
@@ -142,6 +142,9 @@ GIT_INLINE(int) git__is_sizet(git_off_t p)
extern char *git__strtok(char *output, char *src, char *delimit);
extern char *git__strtok_keep(char *output, char *src, char *delimit);
+extern void git__strntolower(char *str, int len);
+extern void git__strtolower(char *str);
+
#define STRLEN(str) (sizeof(str) - 1)
#define GIT_OID_LINE_LENGTH(header) (STRLEN(header) + 1 + GIT_OID_HEXSZ + 1)