Merge topic 'update-kwsys'

7df291f Merge branch 'upstream-kwsys' into update-kwsys
9d66f74 KWSys 2013-02-05 (5c34ed2e)
This commit is contained in:
Brad King 2013-02-08 13:38:23 -05:00 committed by CMake Topic Stage
commit e8df4cab82
1 changed files with 10 additions and 18 deletions

View File

@ -196,18 +196,16 @@ inline int Rmdir(const char* dir)
} }
inline const char* Getcwd(char* buf, unsigned int len) inline const char* Getcwd(char* buf, unsigned int len)
{ {
const char* ret = _getcwd(buf, len); if(const char* ret = _getcwd(buf, len))
if(!ret)
{ {
fprintf(stderr, "No current working directory.\n"); // make sure the drive letter is capital
abort(); if(strlen(buf) > 1 && buf[1] == ':')
{
buf[0] = toupper(buf[0]);
}
return ret;
} }
// make sure the drive letter is capital return 0;
if(strlen(buf) > 1 && buf[1] == ':')
{
buf[0] = toupper(buf[0]);
}
return ret;
} }
inline int Chdir(const char* dir) 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) inline const char* Getcwd(char* buf, unsigned int len)
{ {
const char* ret = getcwd(buf, len); return getcwd(buf, len);
if(!ret)
{
fprintf(stderr, "No current working directory\n");
abort();
}
return ret;
} }
inline int Chdir(const char* dir) inline int Chdir(const char* dir)
@ -3089,7 +3081,7 @@ kwsys_stl::string SystemTools::CollapseFullPath(const char* in_path,
} }
else else
{ {
// ?? base_components.push_back("");
} }
} }