diff options
author | Michi Henning <michi@zeroc.com> | 2004-12-29 03:50:52 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2004-12-29 03:50:52 +0000 |
commit | 5e8559fce24e8408a70d2dc5c175cecf350aec9b (patch) | |
tree | 9cddcc10d35c05de7d75e377a854c4473935f1b7 /cpp/src/IcePatch2/Server.cpp | |
parent | fixed retry logging (diff) | |
download | ice-5e8559fce24e8408a70d2dc5c175cecf350aec9b.tar.bz2 ice-5e8559fce24e8408a70d2dc5c175cecf350aec9b.tar.xz ice-5e8559fce24e8408a70d2dc5c175cecf350aec9b.zip |
Fixed bug in checkedCast template.
Diffstat (limited to 'cpp/src/IcePatch2/Server.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Server.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/cpp/src/IcePatch2/Server.cpp b/cpp/src/IcePatch2/Server.cpp index 7f30e1169d5..013f66c0c11 100644 --- a/cpp/src/IcePatch2/Server.cpp +++ b/cpp/src/IcePatch2/Server.cpp @@ -16,6 +16,9 @@ # include <direct.h> #endif +#include <sys/types.h> +#include <sys/stat.h> + using namespace std; using namespace Ice; using namespace IcePatch2; @@ -122,28 +125,16 @@ IcePatch2::PatcherService::start(int argc, char* argv[]) } } + if(!isDir(dataDir)) + { + throw "`" + dataDir + "' is not a directory"; + } + FileInfoSeq infoSeq; try { -#ifdef _WIN32 - if(dataDir[0] != '/' && !(dataDir.size() > 1 && isalpha(dataDir[0]) && dataDir[1] == ':')) - { - 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 - { - throw "cannot get the current directory:\n" + lastError(); - } - - dataDir = string(cwd) + '/' + dataDir; - } - + dataDir = normalize(dataDir); loadFileInfoSeq(dataDir, infoSeq); } catch(const string& ex) @@ -243,7 +234,7 @@ IcePatch2::PatcherService::usage(const string& appName) "--nochdir Do not change the current working directory." ); #endif - cerr << "Usage: " << appName << " [options] [DIR]" << endl; + cerr << "Usage: " << appName << " [options] DIR" << endl; cerr << options << endl; } |