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 6e37e198)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0c74488e
......@@ -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();
......
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