summaryrefslogtreecommitdiffstats
path: root/Source/cmCommandArgumentParserHelper.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-06-04 19:57:33 (GMT)
committerBrad King <brad.king@kitware.com>2007-06-04 19:57:33 (GMT)
commite40c51dddf7428d25543c0f05d6a6cc16454c97f (patch)
treeeb2d44ad19e284a17c125d6047a01655187a9646 /Source/cmCommandArgumentParserHelper.cxx
parent64a8eb990ac12152a9c74f273978b926edec3724 (diff)
downloadCMake-e40c51dddf7428d25543c0f05d6a6cc16454c97f.zip
CMake-e40c51dddf7428d25543c0f05d6a6cc16454c97f.tar.gz
CMake-e40c51dddf7428d25543c0f05d6a6cc16454c97f.tar.bz2
BUG: Fixed cmCommandArgumentLexer no-escape mode to not match backslash-escape sequences as lexical tokens at all. Needed to configure files with backslashes preceding an @VAR@ replacement. This fixes bug#5130.
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index cae9256..30e91a7 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -213,15 +213,6 @@ void cmCommandArgumentParserHelper::AllocateParserType
bool cmCommandArgumentParserHelper::HandleEscapeSymbol
(cmCommandArgumentParserHelper::ParserType* pt, char symbol)
{
- if ( this->NoEscapeMode )
- {
- char buffer[3];
- buffer[0] = '\\';
- buffer[1] = symbol;
- buffer[2] = 0;
- this->AllocateParserType(pt, buffer, 2);
- return true;
- }
switch ( symbol )
{
case '\\':
@@ -260,6 +251,8 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol
return true;
}
+void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes);
+
int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
{
if ( !str)
@@ -276,6 +269,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
yyscan_t yyscanner;
cmCommandArgument_yylex_init(&yyscanner);
cmCommandArgument_yyset_extra(this, yyscanner);
+ cmCommandArgument_SetupEscapes(yyscanner, this->NoEscapeMode);
int res = cmCommandArgument_yyparse(yyscanner);
cmCommandArgument_yylex_destroy(yyscanner);
if ( res != 0 )