[vlc-commits] Determine psz_vlcpath in according to a location of DLL not the executable on OS /2

KO Myung-Hun git at videolan.org
Wed Jan 11 10:04:42 CET 2012


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Tue Jan 10 21:07:05 2012 +0900| [6e37e1988276bcd8e24cd71046ec55172063700b] | committer: Jean-Baptiste Kempf

Determine psz_vlcpath in according to a location of DLL not the executable on OS/2

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/os2/specific.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/os2/specific.c b/src/os2/specific.c
index 7cdb3a3..6d2e61c 100644
--- a/src/os2/specific.c
+++ b/src/os2/specific.c
@@ -32,28 +32,22 @@ extern int _fmode_bin;
 
 void system_Init( void )
 {
-    PPIB ppib;
-    CHAR psz_path[ CCHMAXPATH ];
-    PSZ  psz_dirsep;
+    HMODULE hmod;
+    CHAR    psz_path[ CCHMAXPATH ];
+    PSZ     psz_dirsep;
 
-    DosGetInfoBlocks( NULL, &ppib );
+    DosQueryModFromEIP( &hmod, NULL, 0, NULL, NULL, ( ULONG )system_Init );
+    DosQueryModuleName( hmod, sizeof( psz_path ), psz_path );
 
-    DosQueryModuleName( ppib->pib_hmte, sizeof( psz_path ), psz_path );
-
-    /* remove the executable name */
+    /* remove the DLL name */
     psz_dirsep = strrchr( psz_path, '\\');
     if( psz_dirsep )
         *psz_dirsep = '\0';
 
-    /* remove the last directory, i.e, \\bin */
-    psz_dirsep = strrchr( psz_path, '\\' );
-    if( psz_dirsep )
-        *psz_dirsep = '\0';
-
     DosEnterCritSec();
 
     if( !psz_vlcpath )
-        asprintf( &psz_vlcpath, "%s\\lib\\vlc", psz_path );
+        asprintf( &psz_vlcpath, "%s\\vlc", psz_path );
 
     DosExitCritSec();
 



More information about the vlc-commits mailing list