summaryrefslogtreecommitdiff
path: root/src/path.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-04-14 15:47:27 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-04-14 23:02:51 +0100
commit1d95b59b4dbd8eda3f83f8af2a4ae07c7cdfc245 (patch)
tree88e04d8ab4d21597002f8b74d8775677f69b104f /src/path.c
parent4f4b1139d23a7b38cceb9d83acbfaf73151f522f (diff)
downloadlibgit2-1d95b59b4dbd8eda3f83f8af2a4ae07c7cdfc245.tar.gz
utf8: refactor utf8 functions
Move the utf8 functions into a proper namespace `git_utf8` instead of being in the namespaceless `git__` function group. Update them to have out-params first and use `char *` instead of `uint8_t *` to match our API treating strings as `char *` (even if they truly contain `uchar`s inside).
Diffstat (limited to 'src/path.c')
-rw-r--r--src/path.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/path.c b/src/path.c
index dde3efb63..8ebb58158 100644
--- a/src/path.c
+++ b/src/path.c
@@ -1562,8 +1562,8 @@ GIT_INLINE(bool) verify_dospath(
static int32_t next_hfs_char(const char **in, size_t *len)
{
while (*len) {
- int32_t codepoint;
- int cp_len = git__utf8_iterate((const uint8_t *)(*in), (int)(*len), &codepoint);
+ uint32_t codepoint;
+ int cp_len = git_utf8_iterate(&codepoint, *in, *len);
if (cp_len < 0)
return -1;
@@ -1595,7 +1595,7 @@ static int32_t next_hfs_char(const char **in, size_t *len)
* the ASCII range, which is perfectly fine, because the
* git folder name can only be composed of ascii characters
*/
- return git__tolower(codepoint);
+ return git__tolower((int)codepoint);
}
return 0; /* NULL byte -- end of string */
}