diff options
author | Matthew Newhook <matthew@zeroc.com> | 2005-12-16 17:16:05 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2005-12-16 17:16:05 +0000 |
commit | 20de27fa7ed8ba789c0859b8e858610419fcb2c6 (patch) | |
tree | 2ab9a32b38b2c95231d509d57302f544639c5b9d /cpp/src/IcePatch2/Calc.cpp | |
parent | added file. (diff) | |
download | ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.tar.bz2 ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.tar.xz ice-20de27fa7ed8ba789c0859b8e858610419fcb2c6.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=679
Diffstat (limited to 'cpp/src/IcePatch2/Calc.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Calc.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/cpp/src/IcePatch2/Calc.cpp b/cpp/src/IcePatch2/Calc.cpp index 0e4e7e40321..aa82650ab4a 100644 --- a/cpp/src/IcePatch2/Calc.cpp +++ b/cpp/src/IcePatch2/Calc.cpp @@ -8,11 +8,9 @@ // ********************************************************************** #include <IceUtil/Options.h> +#include <IceUtil/Unicode.h> #include <IcePatch2/Util.h> - -#ifdef _WIN32 -# include <direct.h> -#endif +#include <OS.h> using namespace std; using namespace Ice; @@ -186,30 +184,22 @@ main(int argc, char* argv[]) StringSeq::iterator p; string absDataDir = dataDir; -#ifdef _WIN32 - char cwd[_MAX_PATH]; - if(_getcwd(cwd, _MAX_PATH) == NULL) - { - throw "cannot get the current directory:\n" + lastError(); - } -#else - char cwd[PATH_MAX]; - if(getcwd(cwd, PATH_MAX) == NULL) + string cwd; + if(OS::getcwd(cwd) != 0) { throw "cannot get the current directory:\n" + lastError(); } -#endif if(!isAbsolute(absDataDir)) { - absDataDir = simplify(string(cwd) + '/' + absDataDir); + absDataDir = simplify(cwd + '/' + absDataDir); } for(p = fileSeq.begin(); p != fileSeq.end(); ++p) { if(!isAbsolute(*p)) { - *p = string(cwd) + '/' + *p; + *p = cwd + '/' + *p; } } |