summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx16
1 files changed, 3 insertions, 13 deletions
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 8502e57..091b065 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -78,21 +78,11 @@ bool cmGetFilenameComponentCommand
else if (args[2] == "ABSOLUTE" ||
args[2] == "REALPATH")
{
+ // Collapse the path to its simplest form.
// If the path given is relative evaluate it relative to the
// current source directory.
- if(!cmSystemTools::FileIsFullPath(filename.c_str()))
- {
- std::string fname = this->Makefile->GetCurrentDirectory();
- if(!fname.empty())
- {
- fname += "/";
- fname += filename;
- filename = fname;
- }
- }
-
- // Collapse the path to its simplest form.
- result = cmSystemTools::CollapseFullPath(filename.c_str());
+ result = cmSystemTools::CollapseFullPath(
+ filename.c_str(), this->Makefile->GetCurrentDirectory());
if(args[2] == "REALPATH")
{
// Resolve symlinks if possible