diff options
author | Vicent Marti <tanoku@gmail.com> | 2013-11-01 17:07:44 +0100 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2013-11-01 17:36:09 +0100 |
commit | 0bfa73234263de03e5f797c2f4c514def145433a (patch) | |
tree | 229fc54b09b13cd6283a513edfd0174f4d12641f /src/refs.c | |
parent | 95352b7058fe3166689e5af0b3b0a38e7c6f63a0 (diff) | |
download | libgit2-0bfa73234263de03e5f797c2f4c514def145433a.tar.gz |
iconv: Do not fake an API when iconv is not available
Diffstat (limited to 'src/refs.c')
-rw-r--r-- | src/refs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c index 269c5f54e..472a79890 100644 --- a/src/refs.c +++ b/src/refs.c @@ -737,7 +737,10 @@ int git_reference__normalize_name( int segment_len, segments_count = 0, error = GIT_EINVALIDSPEC; unsigned int process_flags; bool normalize = (buf != NULL); + +#ifdef GIT_USE_ICONV git_path_iconv_t ic = GIT_PATH_ICONV_INIT; +#endif assert(name); @@ -750,6 +753,7 @@ int git_reference__normalize_name( if (normalize) git_buf_clear(buf); +#ifdef GIT_USE_ICONV if ((flags & GIT_REF_FORMAT__PRECOMPOSE_UNICODE) != 0) { size_t namelen = strlen(current); if ((error = git_path_iconv_init_precompose(&ic)) < 0 || @@ -757,6 +761,7 @@ int git_reference__normalize_name( goto cleanup; error = GIT_EINVALIDSPEC; } +#endif while (true) { segment_len = ensure_segment_validity(current); @@ -834,7 +839,9 @@ cleanup: if (error && normalize) git_buf_free(buf); +#ifdef GIT_USE_ICONV git_path_iconv_clear(&ic); +#endif return error; } |