diff options
author | Marc Laukien <marc@zeroc.com> | 2005-01-27 22:37:17 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2005-01-27 22:37:17 +0000 |
commit | 5b5b9d594d4f465103f6b72acfd4194a00a78541 (patch) | |
tree | f5726ff5065de40ff34494199fdbdfcc9e0260b8 /cpp/src/IcePatch2/Calc.cpp | |
parent | service cleanup (diff) | |
download | ice-5b5b9d594d4f465103f6b72acfd4194a00a78541.tar.bz2 ice-5b5b9d594d4f465103f6b72acfd4194a00a78541.tar.xz ice-5b5b9d594d4f465103f6b72acfd4194a00a78541.zip |
more fixes
Diffstat (limited to 'cpp/src/IcePatch2/Calc.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Calc.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/cpp/src/IcePatch2/Calc.cpp b/cpp/src/IcePatch2/Calc.cpp index 358794c146d..7846de7c0f0 100644 --- a/cpp/src/IcePatch2/Calc.cpp +++ b/cpp/src/IcePatch2/Calc.cpp @@ -192,39 +192,26 @@ main(int argc, char* argv[]) { throw "cannot get the current directory:\n" + lastError(); } - - if(absDataDir[0] != '/' && !(absDataDir.size() > 1 && isalpha(absDataDir[0]) && absDataDir[1] == ':')) - { - absDataDir = string(cwd) + '/' + absDataDir; - } - - for(p = fileSeq.begin(); p != fileSeq.end(); ++p) - { - if((*p)[0] != '/' && !(p->size() > 1 && isalpha((*p)[0]) && (*p)[1] == ':')) - { - *p = string(cwd) + '/' + *p; - } - } #else char cwd[PATH_MAX]; if(getcwd(cwd, PATH_MAX) == NULL) { throw "cannot get the current directory:\n" + lastError(); } - - if(absDataDir[0] != '/') +#endif + + if(!isAbsolute(absDataDir)) { - absDataDir = string(cwd) + '/' + absDataDir; + absDataDir = simplify(string(cwd) + '/' + absDataDir); } for(p = fileSeq.begin(); p != fileSeq.end(); ++p) { - if((*p)[0] != '/') + if(!isAbsolute(*p)) { *p = string(cwd) + '/' + *p; } } -#endif string absDataDirWithSlash = absDataDir + '/'; |