Skip to content

Commit

Permalink
RepoVarExpand: VarRetriever callback is not needed for backslash esca…
Browse files Browse the repository at this point in the history
…ped literals
  • Loading branch information
mlandres committed Dec 15, 2023
1 parent 9ce8905 commit 1faba2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zypp/repo/RepoVariables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,10 @@ namespace zypp
while ( scan.nextVar() )
{
static const std::string _emptyValue;
const std::string *const knownVar = ( varRetriever_r ? varRetriever_r( scan.varName() ) : nullptr );

int varType = scan.varType();
// VarRetriever callback is not needed for backslash escaped literals (varType '\\')
const std::string *const knownVar = ( varType != '\\' && varRetriever_r ? varRetriever_r( scan.varName() ) : nullptr );
const std::string & varValue( knownVar ? *knownVar : _emptyValue );

#if ( ZYPP_DBG_VAREXPAND )
Expand All @@ -309,7 +312,6 @@ namespace zypp
bool mustSubstitute = false; // keep original text per default
std::string substitutionValue;

int varType = scan.varType();
if ( varType == '$' ) // plain var
{
if ( knownVar )
Expand Down

0 comments on commit 1faba2a

Please sign in to comment.