[Mplayer-cvslog] CVS: main get_path.c,1.2,1.3
Sascha Sommer CVS
faust3 at mplayerhq.hu
Fri Apr 18 20:17:29 CEST 2003
- Previous message: [Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.85,1.86 vd_libmpeg2.c,1.20,1.21 vf_pp.c,1.26,1.27 mp_image.h,1.22,1.23
- Next message: [Mplayer-cvslog] CVS: main get_path.c,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv31969
Modified Files:
get_path.c
Log Message:
allow config file loading outside of cygwin environment
Index: get_path.c
===================================================================
RCS file: /cvsroot/mplayer/main/get_path.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- get_path.c 25 Dec 2001 20:41:04 -0000 1.2
+++ get_path.c 18 Apr 2003 18:17:05 -0000 1.3
@@ -2,11 +2,27 @@
char *get_path(char *filename){
char *homedir;
char *buff;
+#if defined(__MINGW32__)||defined(__CYGWIN__)
+ static char *config_dir = "/mplayer";
+#else
static char *config_dir = "/.mplayer";
+#endif
int len;
if ((homedir = getenv("HOME")) == NULL)
+#if defined(__MINGW32__)||defined(__CYGWIN__) /*hack to get fonts etc. loaded outside of cygwin environment*/
+ {
+ int __stdcall GetModuleFileNameA(void* hModule,char* lpFilename,int nSize);
+ int i,imax=0;
+ char exedir[MAX_PATH];
+ GetModuleFileNameA(NULL, exedir, MAX_PATH);
+ for(i=0; i< strlen(exedir);i++)if(exedir[i] =='\\'){exedir[i]='/';imax=i;}
+ exedir[imax]='\0';
+ homedir = exedir;
+ }
+#else
return NULL;
+#endif
len = strlen(homedir) + strlen(config_dir) + 1;
if (filename == NULL) {
if ((buff = (char *) malloc(len)) == NULL)
- Previous message: [Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.85,1.86 vd_libmpeg2.c,1.20,1.21 vf_pp.c,1.26,1.27 mp_image.h,1.22,1.23
- Next message: [Mplayer-cvslog] CVS: main get_path.c,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list