diff options
author | Russell Belfer <rb@github.com> | 2013-10-01 03:58:33 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-10-03 21:44:13 +0400 |
commit | 2fe54afa2a8f87d03d2d550dcde7718f27e40967 (patch) | |
tree | 262b9bcbe9ccf920f84ee1e7aa8d51d352850ead /src/path.c | |
parent | 6b7991e264b2fb0448e3dc47f972bafabf38c1fa (diff) |
Put hooks in place for precompose in dirload fn
This doesn't actual do string precompose but it puts the hooks in
place into the iterators and the git_path_dirload function so that
the actual precompose work is ready to go.
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/path.c b/src/path.c index 9d8e90361..c4ab57136 100644 --- a/src/path.c +++ b/src/path.c @@ -781,6 +781,7 @@ int git_path_dirload( const char *path, size_t prefix_len, size_t alloc_extra, + unsigned int flags, git_vector *contents) { int error, need_slash; @@ -816,6 +817,12 @@ int git_path_dirload( entry_len = strlen(de->d_name); + /* if we read decomposed unicode and precompose flag is set, + * then precompose it now so app code sees it as precomposed + */ + if ((flags & GIT_PATH_DIRLOAD_PRECOMPOSE_UNICODE) != 0) { + } + entry_path = git__malloc( path_len + need_slash + entry_len + 1 + alloc_extra); GITERR_CHECK_ALLOC(entry_path); @@ -858,7 +865,7 @@ int git_path_with_stat_cmp_icase(const void *a, const void *b) int git_path_dirload_with_stat( const char *path, size_t prefix_len, - bool ignore_case, + unsigned int flags, const char *start_stat, const char *end_stat, git_vector *contents) @@ -875,13 +882,14 @@ int git_path_dirload_with_stat( return -1; error = git_path_dirload( - path, prefix_len, sizeof(git_path_with_stat) + 1, contents); + path, prefix_len, sizeof(git_path_with_stat) + 1, flags, contents); if (error < 0) { git_buf_free(&full); return error; } - strncomp = ignore_case ? git__strncasecmp : git__strncmp; + strncomp = (flags & GIT_PATH_DIRLOAD_IGNORE_CASE) != 0 ? + git__strncasecmp : git__strncmp; /* stat struct at start of git_path_with_stat, so shift path text */ git_vector_foreach(contents, i, ps) { |