Bug 98483 - Confusing description of Exec quoting rules
Summary: Confusing description of Exec quoting rules
Status: RESOLVED MOVED
Alias: None
Product: Specifications
Classification: Unclassified
Component: desktop-entry (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Allison Lortie (desrt)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-28 20:32 UTC by Roman
Modified: 2019-02-16 12:27 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Roman 2016-10-28 20:32:33 UTC
From
https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html

"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."

But if general escape rule is applied before, than there should be no tabs, no spaces and no new lines. So why are they listed in the Reserved characters list?

"If an argument contains a reserved character the argument must be quoted"
...
"Reserved characters are space (" "), tab, newline..."

I.e. following spec it should be like this:

original: hello    $world (here's tab)
escaped: hello\t$world
quoted: "hello\\t\$"

Which is again controversial to spec since it states dollar sign must be presented as "\\$". 

I believe the spec contains an error and the actual order is to apply quoting rule before general escaping.

quoted: "hello\t\$world"
escaped: "hello\\t\\$world"

Also spec should have more examples on this topic.
Comment 1 Roman 2016-10-31 22:17:20 UTC
I found similar complaints on the mailing list https://lists.freedesktop.org/archives/xdg/2010-October/011648.html
It looks nothing has changed since then.
Comment 2 GitLab Migration User 2019-02-16 12:27:13 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/desktop-file-utils/issues/48.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.