summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-07 11:45:32 -0700
committerRussell Belfer <rb@github.com>2014-04-07 11:45:32 -0700
commitc813b345503f7b086da7ca1b2d95270e00594323 (patch)
tree5886b1512228c2b651f7c646a277ebf605ec3761 /src
parent6720eef938d7614cd7a9fd2138a27da3667d62cf (diff)
downloadlibgit2-c813b345503f7b086da7ca1b2d95270e00594323.tar.gz
Fix bug with multiple iconv conversions in one dir
The internal buffer in the `git_path_iconv_t` structure was not being reset before the calls to `iconv` were made to convert data, so if there were multiple decomposed Unicode paths in a single directory, paths after the first one were being appended to the first instead of treated as independent data.
Diffstat (limited to 'src')
-rw-r--r--src/path.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/path.c b/src/path.c
index 1dccf90da..56b6c87f9 100644
--- a/src/path.c
+++ b/src/path.c
@@ -782,6 +782,8 @@ int git_path_iconv(git_path_iconv_t *ic, char **in, size_t *inlen)
!git_path_has_non_ascii(*in, *inlen))
return 0;
+ git_buf_truncate(&ic->buf, 0);
+
while (1) {
if (git_buf_grow(&ic->buf, wantlen + 1) < 0)
return -1;