Mercurial > mplayer.hg
annotate get_path.c @ 3161:950496933384
configure cleanups:
a few typos
a few reordering (C src / _blah=no / cc_check && _blah=yes)
preliminary support to display a summary of enabled modules at the end
of the run of ./configure (only AO & VO right now/check for _{a,v}omodules)
cleanups of config.mak : X_LIBS gathered everything and whatever -
no longer the case
Makefile cleanups to match the ones done in config.mak
NB: it still compiles here (but I'm pretty sure this will break on some systems :)
author | pl |
---|---|
date | Tue, 27 Nov 2001 17:58:29 +0000 |
parents | 6a74454ea121 |
children | d21bae2028a6 |
rev | line source |
---|---|
2557 | 1 |
2 char *get_path(char *filename){ | |
3 char *homedir; | |
4 char *buff; | |
5 static char *config_dir = "/.mplayer"; | |
6 int len; | |
7 | |
8 if ((homedir = getenv("HOME")) == NULL) | |
9 return NULL; | |
10 len = strlen(homedir) + strlen(config_dir) + 1; | |
11 if (filename == NULL) { | |
12 if ((buff = (char *) malloc(len)) == NULL) | |
13 return NULL; | |
14 sprintf(buff, "%s%s", homedir, config_dir); | |
15 } else { | |
16 len += strlen(filename) + 1; | |
17 if ((buff = (char *) malloc(len)) == NULL) | |
18 return NULL; | |
19 sprintf(buff, "%s%s/%s", homedir, config_dir, filename); | |
20 } | |
21 return buff; | |
22 } |