mirror of https://github.com/mpv-player/mpv
On OS/2, fall back on the directory where MPlayer is installed if both
MPLAYER_HOME and HOME are not set. patch by KO Myung-Hun, komh chollian net git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26088 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1cd1c92fb7
commit
160b9e62dc
24
get_path.c
24
get_path.c
|
@ -23,6 +23,11 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __OS2__
|
||||||
|
#define INCL_DOS
|
||||||
|
#include <os2.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
char *get_path(const char *filename){
|
char *get_path(const char *filename){
|
||||||
char *homedir;
|
char *homedir;
|
||||||
char *buff;
|
char *buff;
|
||||||
|
@ -56,6 +61,25 @@ char *get_path(const char *filename){
|
||||||
exedir[imax]='\0';
|
exedir[imax]='\0';
|
||||||
homedir = exedir;
|
homedir = exedir;
|
||||||
}
|
}
|
||||||
|
#elif defined(__OS2__)
|
||||||
|
{
|
||||||
|
PPIB ppib;
|
||||||
|
char path[260];
|
||||||
|
|
||||||
|
// Get process info blocks
|
||||||
|
DosGetInfoBlocks(NULL, &ppib);
|
||||||
|
|
||||||
|
// Get full path of the executable
|
||||||
|
DosQueryModuleName(ppib->pib_hmte, sizeof( path ), path);
|
||||||
|
|
||||||
|
// Truncate name part including last backslash
|
||||||
|
*strrchr(path, '\\') = 0;
|
||||||
|
|
||||||
|
// Convert backslash to slash
|
||||||
|
_fnslashify(path);
|
||||||
|
|
||||||
|
homedir = path;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue