summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemTools.cxx26
1 files changed, 1 insertions, 25 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 94b7591..814c417 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -3975,31 +3975,7 @@ bool SystemTools::SetPermissions(const char* file, mode_t mode)
kwsys_stl::string SystemTools::GetParentDirectory(const char* fileOrDir)
{
- if ( !fileOrDir || !*fileOrDir || !SystemTools::FileExists(fileOrDir))
- {
- return "";
- }
- kwsys_stl::string res = fileOrDir;
- SystemTools::ConvertToUnixSlashes(res);
-
- // If the root "/" directory is passed in, return empty string
- if(strcmp(res.c_str(), "/") ==0 )
- {
- return "";
- }
- kwsys_stl::string::size_type cc = res.size()-1;
- if ( res[cc] == '/' )
- {
- cc --;
- }
- for ( ; cc > 0; cc -- )
- {
- if ( res[cc] == '/' )
- {
- break;
- }
- }
- return res.substr(0, cc);
+ return SystemTools::GetFilenamePath(fileOrDir);
}
bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir)