summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2003-06-11 15:00:59 (GMT)
committerBrad King <brad.king@kitware.com>2003-06-11 15:00:59 (GMT)
commitd92dcccb060dcd5e73fd27d9470972a5c5f76994 (patch)
tree1b8c5d8b1dec545004fb35dbcc40e2fd60f8eff0
parentf8d19a24a5bc781f9cc20974cde7b9ac49ccbf88 (diff)
downloadCMake-d92dcccb060dcd5e73fd27d9470972a5c5f76994.zip
CMake-d92dcccb060dcd5e73fd27d9470972a5c5f76994.tar.gz
CMake-d92dcccb060dcd5e73fd27d9470972a5c5f76994.tar.bz2
BUG: Uninitialized std::string returns bad pointers from c_str() on some platforms.
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index badaa0a..e522765 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -1951,7 +1951,7 @@ void cmLocalUnixMakefileGenerator::OutputCustomRules(std::ostream& fout)
cmCustomCommand *c = (*i)->GetCustomCommand();
// escape spaces and convert to native slashes path for
// the command
- const char* comment = c->GetComment().c_str();
+ std::string comment = c->GetComment();
std::string command = c->GetCommand();
cmSystemTools::ReplaceString(command, "/./", "/");
command = cmSystemTools::ConvertToOutputPath(command.c_str());
@@ -1993,7 +1993,7 @@ void cmLocalUnixMakefileGenerator::OutputCustomRules(std::ostream& fout)
if (processedOutputs.find(c->GetOutput()) == processedOutputs.end())
{
this->OutputMakeRule(fout,
- (*comment?comment:"Custom command"),
+ (comment.size()?comment.c_str():"Custom command"),
c->GetOutput().c_str(),
depends.c_str(),
command.c_str());