From 392f542ca74be7b3721e7a4af75544a39e0eceae Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 4 Aug 2009 13:58:23 +0000 Subject: Escaping of the $ sign by doubling it was not always done correctly. --- tools/mhmake/src/mhmakefileparser.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'tools/mhmake/src/mhmakefileparser.cpp') diff --git a/tools/mhmake/src/mhmakefileparser.cpp b/tools/mhmake/src/mhmakefileparser.cpp index 28ad0a682..cbcb33648 100644 --- a/tools/mhmake/src/mhmakefileparser.cpp +++ b/tools/mhmake/src/mhmakefileparser.cpp @@ -167,7 +167,7 @@ string mhmakefileparser::ExpandExpression(const string &Expr) const int i=0; int Length=Expr.size(); string Ret; - bool DollarEscaped=false; + string ToAdd; while (ii) { - Ret+=ExpandMacro(Expr.substr(i,inew-i-1)); + ToAdd=ExpandMacro(Expr.substr(i,inew-i-1)); i=inew; } else { // This is a single character expression - Ret+=ExpandMacro(string(1,Expr[i-1])); + ToAdd=ExpandMacro(string(1,Expr[i-1])); } } + Ret+=ToAdd; } else { Ret+=Char; } - } - // Here we do a special case in case we still have a $ without a % if (m_InExpandExpression==1) { + // Here we do a special case in case we still have a $ within a % if (Ret.find('$')!=string::npos) Ret=ExpandExpression(Ret); - if (DollarEscaped) + int Pos; + while ((Pos=Ret.find("$$"))!=string::npos) { - int Pos; - while ((Pos=Ret.find("$$"))!=string::npos) - { - Ret=Ret.replace(Pos,2,"$"); - } + Ret=Ret.replace(Pos,2,"$"); } } ((mhmakefileparser*)this)->m_InExpandExpression--; -- cgit v1.2.3