[vlc-devel] commit: Win32: strip ".libs" from libvlc path in any case ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Feb 7 17:06:30 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb  7 18:00:26 2010 +0200| [7530a392333c7084e52fc195669ad05de10f63f8] | committer: Rémi Denis-Courmont 

Win32: strip ".libs" from libvlc path in any case

That said, if someone really wants to support running vlc.exe from the
build tree, this is far from sufficient. I would suggest setting
data-path and plugin-path in static compilations of winvlc.c like we
already do for vlc.c instead.

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

 src/win32/specific.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/win32/specific.c b/src/win32/specific.c
index c378396..1478ca8 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -65,20 +65,17 @@ void system_Init( libvlc_int_t *p_this, int *pi_argc, const char *ppsz_argv[] )
         else psz_path[0] = '\0';
     }
 
-    if( (psz_vlc = strrchr( psz_path, '\\' )) ) *psz_vlc = '\0';
+    psz_vlc = strrchr( psz_path, '\\' );
+    if( psz_vlc )
+        *psz_vlc = '\0';
 
-#ifndef HAVE_RELEASE
     {
         /* remove trailing \.libs from executable dir path if seen,
            we assume we are running vlc through libtool wrapper in build dir */
-        int offset  = strlen(psz_path)-sizeof("\\.libs")+1;
-        if( offset > 0 )
-        {
-            psz_vlc = psz_path+offset;
-            if( ! strcmp(psz_vlc, "\\.libs") ) *psz_vlc = '\0';
-        }
+        size_t len = strlen(psz_path);
+        if( len >= 5 && !stricmp(psz_path + len - 5, "\\.libs" ) )
+            psz_path[len - 5] = '\0';
     }
-#endif
 
     psz_vlcpath = strdup( psz_path );
 




More information about the vlc-devel mailing list