desktop entry spec 0.9.7 Exec key parsing

Bastian, Waldo waldo.bastian at intel.com
Tue Oct 31 00:16:17 EET 2006


>> >    * It says that backslashes only escape text within double
quotes,
>> >      but GNOME and KDE both parse
>> >
>> >          one\ word
>> >
>> >      as one word and
>> >
>> >          \"two words\"
>> >
>> >      as two.
>>
>> Yes, so although these constructions are supported by GNOME and KDE,
the
>> spec doesn't allow them and you shouldn't use that.
>
>The spec *does* allow those strings though, it just thinks they should
>be split up differently from how GNOME and KDE do it. Adding backslash
>to the reserved characters list would fix this.

Ah good catch, yes, backslash should be in there, will fix.

>> The single quote character is one of the reserved characters and as
such
>> you must use double quotes around an argument that contains a single
>> quote. Using single quotes in any other way is not allowed by the
spec,
>> although GNOME and KDE might very well support that.
>
>Well, this means some existing .desktop files that were considered
>well-formed according to earlier versions of the spec are now
considered
>invalid, and future .desktop file parsers might not parse them as their
>authors intended. (Google codesearch turns up a handful of .desktop
>files using single quotes, but only a handful, so maybe it's not that
>important.)

Correct, but I think the impact of this will be limited.

>There are also a bunch of .desktop files that use "=" unquoted, which
is
>now considered wrong. Eg:
>
>    Exec=nautilus-cd-burner --source-iso=%f
>
>Maybe make "=" only be reserved in argv[0]? (I assume you put it there
>so that attempts to set environment variables would be marked as
>non-standard.)

I guess we can just forbid it in argv[0] and remove it as reserved
character.

Cheers,
Waldo



More information about the xdg mailing list