diff options
author | Vicent Marti <tanoku@gmail.com> | 2013-08-13 11:15:39 +0400 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2013-08-13 11:15:39 +0400 |
commit | abf3732728d0af42ed7217c7148509c8aa30a7e5 (patch) | |
tree | 068a4aedbc27989e78d6acf14fe638dfcb9bb1cd /tests-clar/clar_libgit2.c | |
parent | 0e26fca1daa11a3108960dee3cb555b4c482ad81 (diff) |
windows: Path conversion with better semantics
Diffstat (limited to 'tests-clar/clar_libgit2.c')
-rw-r--r-- | tests-clar/clar_libgit2.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests-clar/clar_libgit2.c b/tests-clar/clar_libgit2.c index 6c741accd..9e0fbfbac 100644 --- a/tests-clar/clar_libgit2.c +++ b/tests-clar/clar_libgit2.c @@ -56,12 +56,12 @@ void cl_git_rewritefile(const char *filename, const char *new_content) char *cl_getenv(const char *name) { - git_win32_path_utf16 name_utf16; + git_win32_path name_utf16; DWORD alloc_len; wchar_t *value_utf16; char *value_utf8; - git__win32_path_utf8_to_16(name_utf16, name); + git__win32_path_from_c(name_utf16, name); alloc_len = GetEnvironmentVariableW(name_utf16, NULL, 0); if (alloc_len <= 0) return NULL; @@ -72,7 +72,7 @@ char *cl_getenv(const char *name) GetEnvironmentVariableW(name_utf16, value_utf16, alloc_len); cl_assert(value_utf8 = git__malloc(alloc_len)); - git__win32_path_utf16_to_8(value_utf8, value_utf16); + git__utf16_to_8(value_utf8, alloc_len, value_utf16); git__free(value_utf16); @@ -81,13 +81,13 @@ char *cl_getenv(const char *name) int cl_setenv(const char *name, const char *value) { - git_win32_path_utf16 name_utf16; - git_win32_path_utf16 value_utf16; + git_win32_path name_utf16; + git_win32_path value_utf16; - git__win32_path_utf8_to_16(name_utf16, name); + git__win32_path_from_c(name_utf16, name); if (value) { - git__win32_path_utf8_to_16(value_utf16, value); + git__win32_path_from_c(value_utf16, value); cl_assert(SetEnvironmentVariableW(name_utf16, value_utf16)); } else { /* Windows XP returns 0 (failed) when passing NULL for lpValue when @@ -107,12 +107,12 @@ int cl_setenv(const char *name, const char *value) * the source is a directory, a child of the source). */ int cl_rename(const char *source, const char *dest) { - git_win32_path_utf16 source_utf16; - git_win32_path_utf16 dest_utf16; + git_win32_path source_utf16; + git_win32_path dest_utf16; unsigned retries = 1; - git__win32_path_utf8_to_16(source_utf16, source); - git__win32_path_utf8_to_16(dest_utf16, dest); + git__win32_path_from_c(source_utf16, source); + git__win32_path_from_c(dest_utf16, dest); while (!MoveFileW(source_utf16, dest_utf16)) { /* Only retry if the error is ERROR_ACCESS_DENIED; |