[MPlayer-cvslog] r26088 - trunk/get_path.c
diego
subversion at mplayerhq.hu
Sun Feb 24 13:41:51 CET 2008
Author: diego
Date: Sun Feb 24 13:41:51 2008
New Revision: 26088
Log:
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
Modified:
trunk/get_path.c
Modified: trunk/get_path.c
==============================================================================
--- trunk/get_path.c (original)
+++ trunk/get_path.c Sun Feb 24 13:41:51 2008
@@ -23,6 +23,11 @@
#include <windows.h>
#endif
+#ifdef __OS2__
+#define INCL_DOS
+#include <os2.h>
+#endif
+
char *get_path(const char *filename){
char *homedir;
char *buff;
@@ -56,6 +61,25 @@ char *get_path(const char *filename){
exedir[imax]='\0';
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
return NULL;
#endif
More information about the MPlayer-cvslog
mailing list