Commit 2dcf4b20 authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 6e37e1988276bcd8e24cd71046ec55172063700b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0c74488e
...@@ -32,28 +32,22 @@ extern int _fmode_bin; ...@@ -32,28 +32,22 @@ extern int _fmode_bin;
void system_Init( void ) void system_Init( void )
{ {
PPIB ppib; HMODULE hmod;
CHAR psz_path[ CCHMAXPATH ]; CHAR psz_path[ CCHMAXPATH ];
PSZ psz_dirsep; 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 DLL name */
/* remove the executable name */
psz_dirsep = strrchr( psz_path, '\\'); psz_dirsep = strrchr( psz_path, '\\');
if( psz_dirsep ) if( psz_dirsep )
*psz_dirsep = '\0'; *psz_dirsep = '\0';
/* remove the last directory, i.e, \\bin */
psz_dirsep = strrchr( psz_path, '\\' );
if( psz_dirsep )
*psz_dirsep = '\0';
DosEnterCritSec(); DosEnterCritSec();
if( !psz_vlcpath ) if( !psz_vlcpath )
asprintf( &psz_vlcpath, "%s\\lib\\vlc", psz_path ); asprintf( &psz_vlcpath, "%s\\vlc", psz_path );
DosExitCritSec(); DosExitCritSec();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment