generic: fix for directories named *.desktop (!)

Example: gambas3