From 33127043b3ef8dd8dd695ba3613eaa104a80a56b Mon Sep 17 00:00:00 2001 From: Brodie Rao Date: Fri, 14 Oct 2011 14:18:02 -0700 Subject: fileops/posix: replace usage of "int mode" with "mode_t mode" Note: Functions exported from fileops take const mode_t, while the underlying POSIX wrappers take mode_t. --- src/win32/posix.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/win32/posix.h') diff --git a/src/win32/posix.h b/src/win32/posix.h index 442717e42..c0af62b1f 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -19,7 +19,7 @@ GIT_INLINE(int) p_link(const char *GIT_UNUSED(old), const char *GIT_UNUSED(new)) return -1; } -GIT_INLINE(int) p_mkdir(const char *path, int GIT_UNUSED(mode)) +GIT_INLINE(int) p_mkdir(const char *path, mode_t GIT_UNUSED(mode)) { wchar_t* buf = conv_utf8_to_utf16(path); int ret = _wmkdir(buf); @@ -41,12 +41,12 @@ extern int p_mkstemp(char *tmp_path); extern int p_setenv(const char* name, const char* value, int overwrite); extern int p_stat(const char* path, struct stat* buf); extern int p_chdir(const char* path); -extern int p_chmod(const char* path, int mode); +extern int p_chmod(const char* path, mode_t mode); extern int p_rmdir(const char* path); -extern int p_access(const char* path, int mode); +extern int p_access(const char* path, mode_t mode); extern int p_fsync(int fd); extern int p_open(const char *path, int flags); -extern int p_creat(const char *path, int mode); +extern int p_creat(const char *path, mode_t mode); extern int p_getcwd(char *buffer_out, size_t size); #endif -- cgit v1.2.1 From 11d51ca63184b760e2537bbe08c5ca4c63bd4854 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Wed, 26 Oct 2011 16:43:55 -0700 Subject: windows: Add support for non-UTF codepages Our previous assumption that all paths in Windows are encoded in UTF-8 is rather weak, specially when considering that Git is encoding-agnostic. These set of functions allow the user to change the library's active codepage globally, so it is possible to access paths and files on all international versions of Windows. Note that the default encoding here is UTF-8 because we assume that 99% of all Git repositories will be in UTF-8. Also, if you use non-ascii characters in paths, anywhere, please burn on a fire. --- src/win32/posix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/win32/posix.h') diff --git a/src/win32/posix.h b/src/win32/posix.h index 442717e42..3774e7883 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -9,7 +9,7 @@ #include "common.h" #include "fnmatch.h" -#include "utf8-conv.h" +#include "utf-conv.h" GIT_INLINE(int) p_link(const char *GIT_UNUSED(old), const char *GIT_UNUSED(new)) { @@ -21,7 +21,7 @@ GIT_INLINE(int) p_link(const char *GIT_UNUSED(old), const char *GIT_UNUSED(new)) GIT_INLINE(int) p_mkdir(const char *path, int GIT_UNUSED(mode)) { - wchar_t* buf = conv_utf8_to_utf16(path); + wchar_t* buf = gitwin_to_utf16(path); int ret = _wmkdir(buf); GIT_UNUSED_ARG(mode) -- cgit v1.2.1 From 3286c408eccb18c525ca123383f3ebf5097441bc Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Fri, 28 Oct 2011 14:51:13 -0700 Subject: global: Properly use `git__` memory wrappers Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers. --- src/win32/posix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/win32/posix.h') diff --git a/src/win32/posix.h b/src/win32/posix.h index 3774e7883..5dcdb5f85 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -26,7 +26,7 @@ GIT_INLINE(int) p_mkdir(const char *path, int GIT_UNUSED(mode)) GIT_UNUSED_ARG(mode) - free(buf); + git__free(buf); return ret; } -- cgit v1.2.1 From 0c49ec2d3b5bfc32d69d189b7dc69cc26beb6a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 7 Nov 2011 19:34:24 +0100 Subject: Implement p_rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the callers of git_futils_mv_atomic to use p_rename. Signed-off-by: Carlos Martín Nieto --- src/win32/posix.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/win32/posix.h') diff --git a/src/win32/posix.h b/src/win32/posix.h index 7b5553061..ae6323679 100644 --- a/src/win32/posix.h +++ b/src/win32/posix.h @@ -48,5 +48,6 @@ extern int p_fsync(int fd); extern int p_open(const char *path, int flags); extern int p_creat(const char *path, mode_t mode); extern int p_getcwd(char *buffer_out, size_t size); +extern int p_rename(const char *from, const char *to); #endif -- cgit v1.2.1