[vlc-devel] commit: Revert "Probably fix LoadMessages() on windows. (Untested ... I' m not even sure that the config is initialised when we're called. But that shouldn't matter, we' ll just fallback to the default data directory)" (Antoine Cellerier )

git version control git at videolan.org
Tue Dec 22 12:31:44 CET 2009


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Tue Dec 22 11:37:34 2009 +0100| [03fbbec7cb12500ab21fee6b19d2182e3089f4c4] | committer: Antoine Cellerier 

Revert "Probably fix LoadMessages() on windows. (Untested ... I'm not even sure that the config is initialised when we're called. But that shouldn't matter, we'll just fallback to the default data directory)"

This reverts commit 4c5f93c1dd02cd2d79102c256f43cff4c7f9cb99.

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

 src/libvlc.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 72f455a..aa512d2 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -210,7 +210,7 @@ void vlc_release (gc_object_t *p_gc)
     ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
 static void SetLanguage   ( char const * );
 #endif
-static inline int LoadMessages ( libvlc_int_t * );
+static inline int LoadMessages (void);
 static int  GetFilenames  ( libvlc_int_t *, int, const char *[] );
 static void Help          ( libvlc_int_t *, char const *psz_help_name );
 static void Usage         ( libvlc_int_t *, char const *psz_search );
@@ -315,7 +315,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     /*
      * Support for gettext
      */
-    LoadMessages( p_libvlc );
+    LoadMessages ();
 
     /* Initialize the module bank and load the configuration of the
      * main module. We need to do this at this stage to be able to display
@@ -1235,7 +1235,7 @@ static void SetLanguage ( const char *psz_lang )
 #endif
 
 
-static inline int LoadMessages (libvlc_int_t *p_libvlc)
+static inline int LoadMessages (void)
 {
 #if defined( ENABLE_NLS ) \
      && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
@@ -1243,16 +1243,11 @@ static inline int LoadMessages (libvlc_int_t *p_libvlc)
 #if !defined( __APPLE__ ) && !defined( WIN32 ) && !defined( SYS_BEOS )
     static const char psz_path[] = LOCALEDIR;
 #else
-    char *psz_datapath = config_GetDataDir (p_libvlc);
     char psz_path[1024];
     if (snprintf (psz_path, sizeof (psz_path), "%s" DIR_SEP "%s",
-                  psz_datapath, "locale")
+                  config_GetDataDir(), "locale")
                      >= (int)sizeof (psz_path))
-    {
-        free (psz_datapath);
         return -1;
-    }
-    free (psz_datapath);
 
 #endif
     if (bindtextdomain (PACKAGE_NAME, psz_path) == NULL)




More information about the vlc-devel mailing list