Line 895 of the xdg-desktop-menu script passed a file name unquoted to grep: http://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-desktop-menu?id=2baf6ae56f9b622ca51aa79ff370676aaef93908#n895 if grep 'generated and managed by xdg-desktop-menu' $menu_file > /dev/null 2> /dev/null; then On my system I have a file name containing the sequence ' - ', which caused grep to read from stdin, with obscure side effects. I believe that the command should be something like this: grep 'ge…nu' -- "$menu_file"
Since the "-" character is treated as special by http://standards.freedesktop.org/menu-spec/menu-spec-latest.html I'd highly recommend .desktop files use it only to specify vendor as referenced in the spec above. Doing otherwise is just asking for trouble. (While researching this more, there are many occurances of unquoted file access... fixing this potential problem fully will take some care).
Fixed the immediate problem anyway, thanks, http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=c96d7b00aca3da1b608fde5827d7fea8785b3cd3
The desktop files in question were installed by Wine. They had the format "wine-Programs-WindowsVendor-WindowsAppName.desktop" i.e. "wine-" as vendor prefix, and then the directory structure inside the start menu encoded using "-" as structure separator. The way I read the spec you mentioned, that only specifies the part up to the first "-", i.e. "wine-". I can see no restriction on the part after that, although I might well have missed that. In any case, even though I only had two instances of " - " inside desktop files, I had a not more containing spaces, so xdg-desktop-menu should be able to cope with these. Handling that single location is therefore a step in the right direction. Thanks for fixing this.
*** This bug has been marked as a duplicate of bug 66605 ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.