forked from qt-creator/qt-creator
AbstractMacroExpander: Allow escaping of %{Macros}
Use "%{}" to put a literal "%" into the output of the macro expander.
E.g. "%{}{Macro}" will be turned into "%{Macro}"
Change-Id: I592789e5cd8f2d52df424db679baf7ba04723202
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
@@ -126,6 +126,11 @@ int AbstractMacroExpander::findMacro(const QString &str, int *pos, QString *ret)
|
||||
if (closePos < 0)
|
||||
return 0;
|
||||
int varLen = closePos - varPos;
|
||||
if (varLen == 0) { // replace "%{}" with "%"
|
||||
*pos = openPos;
|
||||
*ret = QString(QLatin1Char('%'));
|
||||
return 3;
|
||||
}
|
||||
if (resolveMacro(str.mid(varPos, varLen), ret)) {
|
||||
*pos = openPos;
|
||||
return varLen + 3;
|
||||
|
||||
Reference in New Issue
Block a user