From 4247c9e2c2612394a5f4d63a65ba538f975906d4 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 10 Nov 2009 05:30:26 +0100 Subject: Fixed 3962 - Berkeley DB, problems with unicode paths. --- cpp/src/Slice/Util.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'cpp/src/Slice/Util.cpp') 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 -- cgit v1.2.3