enkore/j4-dmenu-desktop — pull request #13 by freestyl3r (2014-01-29 03:23:49+00:00)
Title: Bad quoting in .desktop files

Hello.
My friend said he couldn't launch a desktop file created by wine through j4-dmenu-desktop but had no problem with xfce's application launcher.

Here is the desktop file:
https://www.dropbox.com/s/2r449drgjdienlv/utorrent%203.0.0%20build%2025422%20Fakeup%205x%20Leecher.desktop

It seems winemenubuilder generated an invalid .desktop file because running it with desktop-file-validate produces the following warning:
`key "Exec" in group "Desktop Entry" contains a reserved character ')' outside of a quote`

It is fixable with the commit attached but that seems to break other "legit" cases. One such example is:
`mkdir test && cd test`
`mkdir " \\(asd"`
`cd \ \\\(asd`
`pwd` : `/home/free/test/ \(asd`

with a desktop exec line as follows
``Exec=/home/free/test/\ \\\`asd/leafpad``

This case will no longer run with my fix but the same can be said for other cases as well such as the ``mkdir ' \`asd'``
that your ``replace(exec, "\\\\`", "\\`");`` line tries to catch.

Those would be pretty obscure paths and it's best that winemenubuilder should generate more correct .desktop files than we trying to fix it here. But malformed files will always happen (as the one few months ago with the extra \n in a translation).

It's your choice if you want to take the fix. :)