It looks fine to me.
In shell, to avoid the loop, I do: if echo ":$XDG_CURRENT_DESKTOP:" | grep -q ":Unity:"; then echo yes else echo no fi
Performance-wise it's fine, it needs only one malloc (for strcat) instead of many (for split), but I'm not sure how readable it is.
« Back to merge proposal
It looks fine to me.
In shell, to avoid the loop, I do: CURRENT_ DESKTOP: " | grep -q ":Unity:"; then
if echo ":$XDG_
echo yes
else
echo no
fi
Performance-wise it's fine, it needs only one malloc (for strcat) instead of many (for split), but I'm not sure how readable it is.