Resolving relative path

This commit is contained in:
Pierre Pronchery 2011-11-06 14:15:55 +00:00
parent ad3ae87923
commit 9b28a97d3e

View File

@ -100,14 +100,17 @@ static int _properties(Mime * mime, int filec, char * const filev[])
int ret = 0; int ret = 0;
int i; int i;
Properties * properties; Properties * properties;
char * p;
for(i = 0; i < filec; i++) for(i = 0; i < filec; i++)
{ {
/* FIXME if relative path get the full path */ p = (filev[i][0] != '/') ? g_build_filename(g_get_current_dir(),
if((properties = _properties_new(mime, filev[i])) == NULL) "/", filev[i], NULL) : g_strdup(filev[i]);
if((properties = _properties_new(mime, p)) == NULL)
ret |= 1; ret |= 1;
else else
_properties_cnt++; _properties_cnt++;
g_free(p);
} }
return ret; return ret;
} }