diff options
author | Mark Spruiell <mes@zeroc.com> | 2015-05-08 11:39:50 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2015-05-08 11:39:50 -0700 |
commit | 6bfc554e86dffc23fe2a305b9fc5fe03196d012a (patch) | |
tree | 8c79645f7850e66ca05fc5416a6f7fcf05c5abe6 /cpp/src/IceSSL/Util.cpp | |
parent | ICE-6493 fixed ObjC enum sequence marshalling/unmarshalling (diff) | |
download | ice-6bfc554e86dffc23fe2a305b9fc5fe03196d012a.tar.bz2 ice-6bfc554e86dffc23fe2a305b9fc5fe03196d012a.tar.xz ice-6bfc554e86dffc23fe2a305b9fc5fe03196d012a.zip |
changing checkPath in IceSSL/C++
Diffstat (limited to 'cpp/src/IceSSL/Util.cpp')
-rw-r--r-- | cpp/src/IceSSL/Util.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp index a95ef6ff8d5..e5c141de149 100644 --- a/cpp/src/IceSSL/Util.cpp +++ b/cpp/src/IceSSL/Util.cpp @@ -1196,20 +1196,35 @@ IceSSL::findCertificates(const string& location, const string& name, const strin #endif bool -IceSSL::checkPath(string& path, const string& defaultDir, bool dir) +IceSSL::checkPath(const string& path, const string& defaultDir, bool dir, string& resolved) { if(IceUtilInternal::isAbsolutePath(path)) { - return dir ? IceUtilInternal::directoryExists(path) : IceUtilInternal::fileExists(path); + if((dir && IceUtilInternal::directoryExists(path)) || (!dir && IceUtilInternal::fileExists(path))) + { + resolved = path; + return true; + } + return false; } // // If a default directory is provided, the given path is relative to the default directory. // + string tmp; if(!defaultDir.empty()) { - path = defaultDir + IceUtilInternal::separator + path; + tmp = defaultDir + IceUtilInternal::separator + path; + } + else + { + tmp = path; } - return dir ? IceUtilInternal::directoryExists(path) : IceUtilInternal::fileExists(path); + if((dir && IceUtilInternal::directoryExists(tmp)) || (!dir && IceUtilInternal::fileExists(tmp))) + { + resolved = tmp; + return true; + } + return false; } |