summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fc92d45..0ce05a8 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1712,8 +1712,16 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
{
markerPos += markerStartSize; // move past marker
// find the end variable marker starting at the markerPos
+ // make sure it is a valid variable between
std::string::size_type endVariablePos =
- source.find(endVariableMarker, markerPos);
+ source.find_first_not_of(
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_",
+ markerPos);
+ if(endVariablePos != std::string::npos &&
+ source[endVariablePos] != endVariableMarker)
+ {
+ endVariablePos = std::string::npos;
+ }
if(endVariablePos == std::string::npos)
{
// no end marker found so add the bogus start