diff options
Diffstat (limited to 'cpp/src/IcePatch2/ClientUtil.cpp')
-rwxr-xr-x | cpp/src/IcePatch2/ClientUtil.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cpp/src/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp index 4c741fa3b3b..9670736406a 100755 --- a/cpp/src/IcePatch2/ClientUtil.cpp +++ b/cpp/src/IcePatch2/ClientUtil.cpp @@ -156,18 +156,21 @@ IcePatch2::Patcher::Patcher(const CommunicatorPtr& communicator, const PatcherFe const_cast<Int&>(_chunkSize) = 1; } + if(_dataDir[0] != '/') + { #ifdef _WIN32 - char cwd[_MAX_PATH]; - if(_getcwd(cwd, _MAX_PATH) == NULL) + char cwd[_MAX_PATH]; + if(_getcwd(cwd, _MAX_PATH) == NULL) #else - char cwd[PATH_MAX]; - if(getcwd(cwd, PATH_MAX) == NULL) + char cwd[PATH_MAX]; + if(getcwd(cwd, PATH_MAX) == NULL) #endif - { - throw "cannot get the current directory:\n" + lastError(); - } + { + throw "cannot get the current directory:\n" + lastError(); + } - const_cast<string&>(_dataDir) = normalize(string(cwd) + '/' + _dataDir); + const_cast<string&>(_dataDir) = string(cwd) + '/' + _dataDir; + } PropertiesPtr properties = communicator->getProperties(); |