[Portland] Re: PATCH: Desktop entry spec - Exec key

Havoc Pennington hp at redhat.com
Tue Aug 8 12:54:54 PDT 2006


If getting this detailed you might search for UNIX98 in the comments in
http://cvs.gnome.org/viewcvs/glib/glib/gshell.c?view=markup

I believe GNOME uses g_shell_parse_command_line for the Exec field, but 
don't know for sure.

Havoc

Bastian, Waldo wrote:
> "
> Arguments may be quoted in whole. If an argument contains a reserved
> character the argument must be quoted. The rules for quoting of
> arguments is also applicable to the executable name or path of the
> executable program as provided.
> 
> Quoting must be done by enclosing the argument between double quotes and
> escaping the double quote character, backtick character ("`"), dollar
> sign ("$") and backslash character ("\") by preceding it with an
> additional backslash character. Implementations must undo quoting before
> expanding field codes and before passing the argument to the executable
> program. Reserved characters are space (" "), tab, newline, double
> quote, single quote ("'"), greater-than sign (">"), less-than sign
> ("<"), tilde ("~"), vertical bar ("|"), ampersand ("&"), semicolon
> (";"), dollar sign ("$"), asterisk ("*"), question mark ("?"), equal
> sign ("="), parenthesis ("(") and (")") and backtick character ("`").
> 
> Note that the general escape rule for values of type string states that
> the backslash character can be escaped as ("\\") as well and that this
> escape rule is applied before the quoting rule. As such, to
> unambiguously represent a literal backslash character in a quoted
> argument in a desktop entry file requires the use of four successive
> backslash characters ("\\\\"). Likewise, a literal dollar sign in a
> quoted argument in a desktop entry file is unambiguously represented
> with ("\\$").
> "
> 



More information about the Portland mailing list