summaryrefslogtreecommitdiffstats
path: root/src/lib/eiotas_particle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eiotas_particle.c')
-rw-r--r--src/lib/eiotas_particle.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/eiotas_particle.c b/src/lib/eiotas_particle.c
index ea00b5c..5f302cf 100644
--- a/src/lib/eiotas_particle.c
+++ b/src/lib/eiotas_particle.c
@@ -229,7 +229,18 @@ static void update_link_value(Eiotas_Particle *particle, const char *field)
}
*dst='\0';
- if(particle->link_value) eina_stringshare_del(particle->link_value);
- particle->link_value = ( (t==1) ? NULL : eina_stringshare_add(tmp) );
+ if(particle->link_value) {
+ if(t==1) {
+ eina_stringshare_del(particle->link_value);
+ particle->link_value = NULL;
+ } else if(strcmp(particle->link_value,tmp)!=0) {
+ eina_stringshare_del(particle->link_value);
+ particle->link_value = eina_stringshare_add(tmp);
+ }
+ /* else : keep the same stringshare */
+ } else if(t!=1) {
+ particle->link_value = eina_stringshare_add(tmp);
+ }
+ /* else : keep particle->link_value=NULL*/
}