[eina] path sanitizing now takes care of '/./' and

breaks loop on '/..$'



Patch by: Jérémy Zurcher <jeremy@asynk.ch>



SVN revision: 79449
This commit is contained in:
Jérémy Zurcher 2012-11-19 13:13:31 +00:00 committed by Gustavo Lima Chaves
parent fbf199f004
commit 9aa23128b6
1 changed files with 12 additions and 2 deletions

View File

@ -551,8 +551,7 @@ _eina_file_escape(const char *path, int *length)
{
len -= p + 2 - q;
result[len] = '\0';
q = p;
++p;
break;
}
else
{
@ -560,6 +559,17 @@ _eina_file_escape(const char *path, int *length)
++p;
}
}
else
if (p[1] == '.'
&& p[2] == '/')
{
// remove '/./'
len -= 2;
memmove(p, p + 2, len - (p - result));
result[len] = '\0';
q = p;
++p;
}
else
{
q = p;