- if (oldrel == REL_AND || oldrel == REL_OR || oldrel == REL_WITH)
- if (rd->flags == REL_AND || rd->flags == REL_OR || rd->flags == REL_WITH)
- if (oldrel != rd->flags)
+ int rel = rd->flags;
+ if (oldrel == REL_AND || oldrel == REL_OR || oldrel == REL_WITH || oldrel == REL_COND || oldrel == REL_ELSE || oldrel == -1)
+ if (rel == REL_AND || rel == REL_OR || rel == REL_WITH || rel == REL_COND || rel == REL_ELSE)
+ if ((oldrel != rel || rel == REL_COND || rel == REL_ELSE) && !(oldrel == REL_COND && rel == REL_ELSE))