From: Olivier Teulière Date: Tue, 18 May 2004 18:47:02 +0000 (+0000) Subject: * skins2/utils/var_text.cpp: avoid an infinite loop when $H is specified in X-Git-Tag: 0.7.2~31 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=5f676c10c6d21c7dca7733d7edb3e79c7174a664;p=vlc * skins2/utils/var_text.cpp: avoid an infinite loop when $H is specified in a help string --- diff --git a/modules/gui/skins2/utils/var_text.cpp b/modules/gui/skins2/utils/var_text.cpp index dd16ad01a7..2146618d42 100755 --- a/modules/gui/skins2/utils/var_text.cpp +++ b/modules/gui/skins2/utils/var_text.cpp @@ -61,7 +61,10 @@ const UString VarText::get() const // $V for volume) UString temp( m_text ); - while( (pos = temp.find( "$H" )) != UString::npos ) + // $H is processed first, in case the help string contains other variables + // to replace. And it is replaced only once, in case one of these other + // variables is $H... + if( (pos = temp.find( "$H" )) != UString::npos ) { VarManager *pVarManager = VarManager::instance( getIntf() ); // We use .getRaw() to avoid replacing the $H recursively!