summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-10-27 12:49:41 (GMT)
committerBrad King <brad.king@kitware.com>2004-10-27 12:49:41 (GMT)
commita2b8c1fbcbe95783c6a1240a3461d35f375a16b6 (patch)
tree6beb705f2c7a45d11bcbc15cae640e8e728bc625
parent0d622ae9e82e286a23ab4fceb1c5f76d6f76b503 (diff)
downloadCMake-a2b8c1fbcbe95783c6a1240a3461d35f375a16b6.zip
CMake-a2b8c1fbcbe95783c6a1240a3461d35f375a16b6.tar.gz
CMake-a2b8c1fbcbe95783c6a1240a3461d35f375a16b6.tar.bz2
BUG: Add a space before the : only if the target name is one letter long. This works around bugs in some shells' tab completion of target names.
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index f00261c..827ad72 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -2585,9 +2585,16 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
std::string tgt = this->ConvertToRelativeOutputPath(replace.c_str());
tgt = this->ConvertToMakeTarget(tgt.c_str());
+ const char* space = "";
+ if(tgt.size() == 1)
+ {
+ // Add a space before the ":" to avoid drive letter confusion on
+ // Windows.
+ space = " ";
+ }
if(depends.empty())
{
- fout << tgt.c_str() << " :\n";
+ fout << tgt.c_str() << space << ":\n";
}
else
{
@@ -2599,7 +2606,7 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
replace = *dep;
m_Makefile->ExpandVariablesInString(replace);
replace = this->ConvertToMakeTarget(replace.c_str());
- fout << tgt.c_str() << " : " << replace.c_str() << "\n";
+ fout << tgt.c_str() << space << ": " << replace.c_str() << "\n";
}
}