diff options
author | Brad King <brad.king@kitware.com> | 2013-02-07 13:34:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-07 13:34:56 (GMT) |
commit | 7df291fb6e6971f60cc7b338bcaa81069ed11757 (patch) | |
tree | 6d7000715eddf1a9a32768cfcb2c14192fcf09a6 /Source/kwsys | |
parent | bc75f4c4c606412429e97d12ef1d550e7096cdfc (diff) | |
parent | 9d66f74335a09019644c7b82af0860da439fce87 (diff) | |
download | CMake-7df291fb6e6971f60cc7b338bcaa81069ed11757.zip CMake-7df291fb6e6971f60cc7b338bcaa81069ed11757.tar.gz CMake-7df291fb6e6971f60cc7b338bcaa81069ed11757.tar.bz2 |
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 881c49a..22bf193 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -196,18 +196,16 @@ inline int Rmdir(const char* dir) } inline const char* Getcwd(char* buf, unsigned int len) { - const char* ret = _getcwd(buf, len); - if(!ret) + if(const char* ret = _getcwd(buf, len)) { - fprintf(stderr, "No current working directory.\n"); - abort(); - } - // make sure the drive letter is capital - if(strlen(buf) > 1 && buf[1] == ':') - { - buf[0] = toupper(buf[0]); + // make sure the drive letter is capital + if(strlen(buf) > 1 && buf[1] == ':') + { + buf[0] = toupper(buf[0]); + } + return ret; } - return ret; + return 0; } inline int Chdir(const char* dir) { @@ -245,13 +243,7 @@ inline int Rmdir(const char* dir) } inline const char* Getcwd(char* buf, unsigned int len) { - const char* ret = getcwd(buf, len); - if(!ret) - { - fprintf(stderr, "No current working directory\n"); - abort(); - } - return ret; + return getcwd(buf, len); } inline int Chdir(const char* dir) @@ -3089,7 +3081,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_path, } else { - // ?? + base_components.push_back(""); } } |