2 char *get_path(char *filename
){
5 static char *config_dir
= "/.mplayer";
8 if ((homedir
= getenv("HOME")) == NULL
)
10 len
= strlen(homedir
) + strlen(config_dir
) + 1;
11 if (filename
== NULL
) {
12 if ((buff
= (char *) malloc(len
)) == NULL
)
14 sprintf(buff
, "%s%s", homedir
, config_dir
);
16 len
+= strlen(filename
) + 1;
17 if ((buff
= (char *) malloc(len
)) == NULL
)
19 sprintf(buff
, "%s%s/%s", homedir
, config_dir
, filename
);
21 mp_msg(MSGT_GLOBAL
,MSGL_V
,"get_path('%s') -> '%s'\n",filename
,buff
);