Desktop Entry Specification needs clarification

Karl Mikaelsson derfian at cendio.se
Mon Oct 11 01:08:06 PDT 2010


On 2010-10-08 15:04, Oswald Buddenhagen wrote:
> On Fri, Oct 08, 2010 at 01:53:24PM +0200, Karl Mikaelsson wrote:
>>> Values of type string may contain all ASCII characters except
>>> for control characters.
>>
>> What's the definition of control characters?<  0x20?<= 0x20?
>>
> per ascii, it is<  0x20.
>
>> How should unknown escape sequences be handled? I.e. does "\k"
>> mean "\k" or "k"?
>>
> whatever. it's invalid.

That's the point of the question, what's the preferred action for 
dealing with invalid quotes? Should a parser make a best effort attempt 
at trying to find out what the user intended, or perhaps refuse to touch 
the rest of the file, or anywhere in between?

> about the quoting in general, you are confusing things. there are
> two distinct layers of quoting: the .ini file quoting and the shell
> quoting. the spec concerns the .ini file quoting, with escaping of
> control chars and leading/trailing spaces (yes, only these *need*
> escaping). what comes out of that for the Exec key is a shell
> command and is subject to the shell's quoting rules, and this is
> what determines how empty arguments are represented, etc.

I'm aware of the two quoting steps. First, transform the argv to a 
string representation, then quote the string to fit into the desktop
entry file format.

The specification doesn't state that the Exec value is a shell command. 
The closest you'll get is "command line", which only says that it's, 
well, a line with a command. However, since the desktop entry 
specification has its own rules for quoting the value of the Exec key, 
you can't say that it's a shell command, since the spec for instance 
doesn't allow for using '':s for quoting, as for instance bourne shell 
allows.

What shell quoting rules are you refering to by the way? As you didn't
specify, perhaps someone will interpret shell command as a tcsh shell
command and quote accordingly to that?

> that's how kde implemented it long before the spec was written, and
> anyone who thinks something different is meant should be shot. ;)

The problem is that until that is explicitly stated by the spec, your 
views are just the opinion of someone on the internet.

-- 
Karl Mikaelsson        derfian at cendio.se
System Developer       +46 (0)13-290863
Cendio AB              http://www.cendio.com/


More information about the xdg mailing list