diff options
author | Jose <jose@zeroc.com> | 2009-11-10 05:30:26 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-11-10 05:30:26 +0100 |
commit | 4247c9e2c2612394a5f4d63a65ba538f975906d4 (patch) | |
tree | 96d3308681d9b0684ce5dd763f5a5d415eaf09d7 /cpp/src/Slice/Util.cpp | |
parent | Win32 64 bits compilation error (diff) | |
download | ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.bz2 ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.tar.xz ice-4247c9e2c2612394a5f4d63a65ba538f975906d4.zip |
Fixed 3962 - Berkeley DB, problems with unicode paths.
Diffstat (limited to 'cpp/src/Slice/Util.cpp')
-rw-r--r-- | cpp/src/Slice/Util.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp index 3ea6b609c9e..e2c4049c2c7 100644 --- a/cpp/src/Slice/Util.cpp +++ b/cpp/src/Slice/Util.cpp @@ -87,29 +87,22 @@ normalizePath(const string& path) string Slice::fullPath(const string& path) { -#ifdef _WIN32 - if(!IceUtilInternal::isAbsolutePath(path)) - { - wchar_t cwdbuf[_MAX_PATH]; - if(_wgetcwd(cwdbuf, _MAX_PATH) != NULL) - { - return normalizePath(IceUtil::wstringToString(cwdbuf) + "/" + path); - } - } - return normalizePath(path); -#else string result = path; if(!IceUtilInternal::isAbsolutePath(result)) { - char cwdbuf[PATH_MAX]; - if(::getcwd(cwdbuf, PATH_MAX) != NULL) + string cwd; + if(IceUtilInternal::getcwd(cwd) == 0) { - result = string(cwdbuf) + '/' + result; + result = string(cwd) + '/' + result; } } result = normalizePath(result); +#ifdef _WIN32 + return result; +#else + string::size_type beg = 0; string::size_type next; do |