summaryrefslogtreecommitdiff
path: root/cpp/src/IceSSL/Util.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2015-05-08 11:39:50 -0700
committerMark Spruiell <mes@zeroc.com>2015-05-08 11:39:50 -0700
commit6bfc554e86dffc23fe2a305b9fc5fe03196d012a (patch)
tree8c79645f7850e66ca05fc5416a6f7fcf05c5abe6 /cpp/src/IceSSL/Util.cpp
parentICE-6493 fixed ObjC enum sequence marshalling/unmarshalling (diff)
downloadice-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.cpp23
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;
}