diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-06-16 19:07:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-16 19:07:15 +0200 |
commit | b4516df9b88989a175f88aa514a187831631f9f8 (patch) | |
tree | 6c699d6b39248593193b1cd9ad5d0430ab4a64ee /strbuf.c | |
parent | Merge branch 'as/pretty-truncate' (diff) | |
parent | daemon/config: factor out duplicate xstrdup_tolower (diff) | |
download | git-b4516df9b88989a175f88aa514a187831631f9f8.tar.xz git-b4516df9b88989a175f88aa514a187831631f9f8.zip |
Merge branch 'jk/daemon-tolower'
* jk/daemon-tolower:
daemon/config: factor out duplicate xstrdup_tolower
Diffstat (limited to 'strbuf.c')
-rw-r--r-- | strbuf.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -563,3 +563,16 @@ int fprintf_ln(FILE *fp, const char *fmt, ...) return -1; return ret + 1; } + +char *xstrdup_tolower(const char *string) +{ + char *result; + size_t len, i; + + len = strlen(string); + result = xmalloc(len + 1); + for (i = 0; i < len; i++) + result[i] = tolower(string[i]); + result[i] = '\0'; + return result; +} |