view get_path.c @ 5420:4ea69b1790d9

modified the new MS RLE decoder to support BGR15/16 output formats in addition to BGR24/32, just like the old XAnim decoder; it's also interesting to note that this commit wantonly violates A'rpi's newest nonsensical CVS policy, and I quote: Note: if you had to put if(){ .. } over big (> 5 lines) code, do NOT change the indent of the inner part (move it right) !
author melanson
date Sun, 31 Mar 2002 15:33:32 +0000
parents d21bae2028a6
children ad429d617df4
line wrap: on
line source


char *get_path(char *filename){
	char *homedir;
	char *buff;
	static char *config_dir = "/.mplayer";
	int len;

	if ((homedir = getenv("HOME")) == NULL)
		return NULL;
	len = strlen(homedir) + strlen(config_dir) + 1;
	if (filename == NULL) {
		if ((buff = (char *) malloc(len)) == NULL)
			return NULL;
		sprintf(buff, "%s%s", homedir, config_dir);
	} else {
		len += strlen(filename) + 1;
		if ((buff = (char *) malloc(len)) == NULL)
			return NULL;
		sprintf(buff, "%s%s/%s", homedir, config_dir, filename);
	}
	mp_msg(MSGT_GLOBAL,MSGL_V,"get_path('%s') -> '%s'\n",filename,buff);
	return buff;
}