On 07/05/2024 23:24, Max Nikulin wrote:
On 2024-05-06 17:04, Max Nikulin wrote:
So doubled backslashes (as in .desktop files) are correct.
What is wrong is lack of backslashes added before ";" and it is a bug.
I have filed
https://bugs.debian.org/1071036
update-mime does not escape semicolon in .desktop Exec entries
This particular bug almost certainly may be fixed by adding an extra
line of perl code.
However 2 layer of quoting in .desktop files: special rules for Exec and
general for any strings require more work to get entries properly
escaped for mailcap in general case.
In the meanwhile I have realized that BASH implementation of parsing
Exec entries in xdg-open fallback function search_desktop_file is really
ugly:
https://gitlab.freedesktop.org/xdg/xdg-utils/-/blob/master/scripts/xdg-open.in?ref_type=heads#L312
I am unsure if it is possible to implement double quotes rule
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
Since xdg-open usually delegates handling of URIs to the desktop
environment, this code is active only for those who avoid any DE.