eve: use file realpath for file:// schema

Author: Marco Trevisan (Treviño) <mail@3v1n0.net>

SVN revision: 55082
This commit is contained in:
Leandro Pereira 2010-11-30 12:36:24 +00:00
parent 487c806dc8
commit c71d905f59
1 changed files with 11 additions and 3 deletions

View File

@ -589,13 +589,21 @@ uri_sanitize(const char *uri) {
tmp = strstr(uri, "://");
if (!tmp || (tmp == uri) || (tmp > (uri + 15)))
{
char *new_uri = NULL;
if (ecore_file_exists(uri))
schema = "file";
{
schema = "file";
new_uri = ecore_file_realpath(uri);
}
else
schema = "http";
if (asprintf(&fixed_uri, "%s://%s", schema, uri) > 0)
return fixed_uri;
if (asprintf(&fixed_uri, "%s://%s", schema, new_uri ? new_uri : uri) > 0)
{
free(new_uri);
return fixed_uri;
}
free(new_uri);
}
else
return strdup(uri);