summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-06-06 13:39:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-06-06 13:39:21 (GMT)
commit85c5a7dbc060bba4bd5939e98c71eb16aa71de2f (patch)
treef3e9f62b1e7f4704b7258ec0b95441a6c1792c12 /Source
parentef56c8056ff726e4d258d7be579a7d6e67e2da7c (diff)
downloadCMake-85c5a7dbc060bba4bd5939e98c71eb16aa71de2f.zip
CMake-85c5a7dbc060bba4bd5939e98c71eb16aa71de2f.tar.gz
CMake-85c5a7dbc060bba4bd5939e98c71eb16aa71de2f.tar.bz2
ENH: fix for replacement of @var @ only legal variable names should be replaced
Diffstat (limited to 'Source')
-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