]> git.sesse.net Git - vlc/commitdiff
* skins2/utils/var_text.cpp: avoid an infinite loop when $H is specified in
authorOlivier Teulière <ipkiss@videolan.org>
Tue, 18 May 2004 18:47:02 +0000 (18:47 +0000)
committerOlivier Teulière <ipkiss@videolan.org>
Tue, 18 May 2004 18:47:02 +0000 (18:47 +0000)
   a help string

modules/gui/skins2/utils/var_text.cpp

index dd16ad01a7470c1ade1fb27ec168d2099702b983..2146618d424d3dee4a0c938c9cb76ee1e7c78e01 100755 (executable)
@@ -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!