From 2b7cf27e61b24e1d234f0670390ce7660d074716 Mon Sep 17 00:00:00 2001
From: Geoff Viola <geoffrey.viola@asirobots.com>
Date: Tue, 24 Mar 2015 23:06:03 -0600
Subject: [PATCH 3/3] cleaned up trailing slash logic

---
 Source/cmGhsMultiTargetGenerator.cxx | 17 +++++++----------
 Source/cmGlobalGhsMultiGenerator.cxx |  3 ++-
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 0b27b3b..cc36044 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -29,13 +29,10 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget const *target)
     , TargetGroup(this->DetermineIfTargetGroup())
     , DynamicDownload(false)
 {
-  std::string BuildFileName;
-  BuildFileName = this->Target->GetName();
-  BuildFileName += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
-
   char const *folderProp = this->Target->GetProperty("FOLDER");
   this->RelBuildFilePath = NULL == folderProp ? "" : folderProp;
-  if (!cmHasLiteralSuffix(this->RelBuildFilePath, "/"))
+  cmSystemTools::ConvertToUnixSlashes(this->RelBuildFilePath);
+  if (!this->RelBuildFilePath.empty())
   {
     this->RelBuildFilePath += "/";
   }
@@ -45,10 +42,9 @@ cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmTarget const *target)
       this->RelBuildFilePath + this->Target->GetName() + ".a";
 
   this->RelBuildFileName = this->RelBuildFilePath;
-  if (!cmHasLiteralSuffix(this->RelBuildFileName, "/"))
-  {
-    this->RelBuildFileName += "/";
-  }
+  std::string BuildFileName;
+  BuildFileName = this->Target->GetName();
+  BuildFileName += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
   this->RelBuildFileName += BuildFileName;
 
   std::string absPathToRoot(this->Makefile->GetHomeOutputDirectory());
@@ -415,7 +411,8 @@ void cmGhsMultiTargetGenerator::WriteObjectDir(
     cmGeneratedFileStream *fileStream, std::string const &dir)
 {
   std::string workingDir(dir);
-  if (!cmHasLiteralSuffix(workingDir, "/"))
+  cmSystemTools::ConvertToUnixSlashes(workingDir);
+  if (!workingDir.empty())
   {
     workingDir += "/";
   }
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 51faf4c..400037f 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -372,7 +372,8 @@ void cmGlobalGhsMultiGenerator::AddFilesUpToPath(
   std::vector<cmsys::String> splitPath =
       cmSystemTools::SplitString(workingPath);
   std::string workingRelPath(relPath);
-  if (!cmHasLiteralSuffix(relPath, "/"))
+  cmSystemTools::ConvertToUnixSlashes(workingRelPath);
+  if (!workingRelPath.empty())
   {
     workingRelPath += "/";
   }
-- 
1.8.1.msysgit.1

