summaryrefslogtreecommitdiffstats
path: root/src/lib/eiotas_particle.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-06-01 15:51:24 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-06-01 15:51:24 +0200
commitad62dda338917350cb678db86a8436a34d045ac9 (patch)
tree859511a02028b7f80abac8d622728c2dcc11e246 /src/lib/eiotas_particle.c
parent3b59cc372b2b34b08041ee9c0096c5ef52334a01 (diff)
downloadedoors-ad62dda338917350cb678db86a8436a34d045ac9.zip
edoors-ad62dda338917350cb678db86a8436a34d045ac9.tar.gz
add_destination: increase wrong path detection
Diffstat (limited to 'src/lib/eiotas_particle.c')
-rw-r--r--src/lib/eiotas_particle.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c
index a72d55f..6d3facc 100644
--- a/src/lib/eiotas_particle.c
+++ b/src/lib/eiotas_particle.c
@@ -117,6 +117,8 @@ EAPI void eiotas_particle_destinations_add(Eiotas_Particle *particle, const char
static Eina_Bool add_destination(Eiotas_Particle *particle, const char *dst, int n)
{
+ int i, c;
+ char *tmp;
Eina_Stringshare *s;
if(n==0) {
@@ -132,6 +134,20 @@ static Eina_Bool add_destination(Eiotas_Particle *particle, const char *dst, int
return EINA_FALSE;
}
+ for(tmp=(char*)dst, c=0, i=0; i<n; i++, tmp++) {
+ if(*tmp==EIOTAS_ACTION_SEP) {
+ if(*(tmp-1)==EIOTAS_PATH_SEP) {
+ ERR("ignore destination with '%c%c' ",EIOTAS_PATH_SEP,EIOTAS_ACTION_SEP);
+ return EINA_FALSE;
+ }
+ c++;
+ }
+ }
+ if(c>1) {
+ ERR("ignore destination with more then 1 '%c' ",EIOTAS_ACTION_SEP);
+ return EINA_FALSE;
+ }
+
s = eina_stringshare_add_length(dst,n);
eina_array_push(particle->dsts,s);
DBG("add dst >%s<",s);