[vlc-devel] commit: Fix --syslog ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Dec 10 17:46:43 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Dec 10 18:45:04 2009 +0200| [a27a45508085160f814823a2792234d9b16a30b1] | committer: Rémi Denis-Courmont 

Fix --syslog

psz_logmode is tested for NULLity, so we need to use *NonEmpty*.
Also, always delete the variable. If the reference count was 1, we will
revert back to the configuration value, which makes no difference.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a27a45508085160f814823a2792234d9b16a30b1
---

 src/libvlc.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index fbe9ccf..07937d6 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -946,7 +946,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
 #ifdef HAVE_SYSLOG_H
     if( config_GetInt( p_libvlc, "syslog" ) > 0 )
     {
-        char *logmode = var_CreateGetString( p_libvlc, "logmode" );
+        char *logmode = var_CreateGetNonEmptyString( p_libvlc, "logmode" );
         var_SetString( p_libvlc, "logmode", "syslog" );
         intf_Create( p_libvlc, "logger,none" );
 
@@ -955,8 +955,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
             var_SetString( p_libvlc, "logmode", logmode );
             free( logmode );
         }
-        else
-            var_Destroy( p_libvlc, "logmode" );
+        var_Destroy( p_libvlc, "logmode" );
     }
 #endif
 




More information about the vlc-devel mailing list