summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch2/Server.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2005-01-27 22:37:17 +0000
committerMarc Laukien <marc@zeroc.com>2005-01-27 22:37:17 +0000
commit5b5b9d594d4f465103f6b72acfd4194a00a78541 (patch)
treef5726ff5065de40ff34494199fdbdfcc9e0260b8 /cpp/src/IcePatch2/Server.cpp
parentservice cleanup (diff)
downloadice-5b5b9d594d4f465103f6b72acfd4194a00a78541.tar.bz2
ice-5b5b9d594d4f465103f6b72acfd4194a00a78541.tar.xz
ice-5b5b9d594d4f465103f6b72acfd4194a00a78541.zip
more fixes
Diffstat (limited to 'cpp/src/IcePatch2/Server.cpp')
-rw-r--r--cpp/src/IcePatch2/Server.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp
index 7abed80da46..468e52a6598 100644
--- a/cpp/src/IcePatch2/Server.cpp
+++ b/cpp/src/IcePatch2/Server.cpp
@@ -69,7 +69,7 @@ IcePatch2::PatcherService::PatcherService()
bool
IcePatch2::PatcherService::start(int argc, char* argv[])
{
- string dataDir;
+ PropertiesPtr properties = communicator()->getProperties();
IceUtil::Options opts;
opts.addOpt("h", "help");
@@ -106,34 +106,27 @@ IcePatch2::PatcherService::start(int argc, char* argv[])
}
if(args.size() == 1)
{
- dataDir = args[0];
+ properties->setProperty("IcePatch2.Directory", simplify(args[0]));
}
- PropertiesPtr properties = communicator()->getProperties();
-
+ string dataDir = properties->getPropertyWithDefault("IcePatch2.Directory", ".");
if(dataDir.empty())
{
- dataDir = properties->getProperty("IcePatch2.Directory");
- if(dataDir.empty())
- {
- error("no data directory specified");
- usage(argv[0]);
- return false;
- }
+ error("no data directory specified");
+ usage(argv[0]);
+ return false;
}
FileInfoSeq infoSeq;
try
{
-#ifdef _WIN32
- if(dataDir[0] != '/' && !(dataDir.size() > 1 && isalpha(dataDir[0]) && dataDir[1] == ':'))
+ if(!isAbsolute(dataDir))
{
+#ifdef _WIN32
char cwd[_MAX_PATH];
if(_getcwd(cwd, _MAX_PATH) == NULL)
#else
- if(dataDir[0] != '/')
- {
char cwd[PATH_MAX];
if(getcwd(cwd, PATH_MAX) == NULL)
#endif