Fossil SCM

Better use GetCurrentDirectoryW in stead of _wgetcwd.

jan.nijtmans 2013-12-13 13:48 trunk
Commit 4e463bf7bac9958d3171c3e385d907c43a1bfd64
1 file changed +1 -1
+1 -1
--- src/file.c
+++ src/file.c
@@ -944,11 +944,11 @@
944944
#ifdef _WIN32
945945
char *zPwdUtf8;
946946
int nPwd;
947947
int i;
948948
wchar_t zPwd[2000];
949
- if( _wgetcwd(zPwd, sizeof(zPwd)/sizeof(zPwd[0])-1)==0 ){
949
+ if( GetCurrentDirectoryW(count(zPwd), zPwd)==0 ){
950950
fossil_fatal("cannot find the current working directory.");
951951
}
952952
zPwdUtf8 = fossil_filename_to_utf8(zPwd);
953953
nPwd = strlen(zPwdUtf8);
954954
if( nPwd > nBuf-1 ){
955955
--- src/file.c
+++ src/file.c
@@ -944,11 +944,11 @@
944 #ifdef _WIN32
945 char *zPwdUtf8;
946 int nPwd;
947 int i;
948 wchar_t zPwd[2000];
949 if( _wgetcwd(zPwd, sizeof(zPwd)/sizeof(zPwd[0])-1)==0 ){
950 fossil_fatal("cannot find the current working directory.");
951 }
952 zPwdUtf8 = fossil_filename_to_utf8(zPwd);
953 nPwd = strlen(zPwdUtf8);
954 if( nPwd > nBuf-1 ){
955
--- src/file.c
+++ src/file.c
@@ -944,11 +944,11 @@
944 #ifdef _WIN32
945 char *zPwdUtf8;
946 int nPwd;
947 int i;
948 wchar_t zPwd[2000];
949 if( GetCurrentDirectoryW(count(zPwd), zPwd)==0 ){
950 fossil_fatal("cannot find the current working directory.");
951 }
952 zPwdUtf8 = fossil_filename_to_utf8(zPwd);
953 nPwd = strlen(zPwdUtf8);
954 if( nPwd > nBuf-1 ){
955

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button