diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-09-24 17:43:35 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-09-25 12:59:50 +0100 |
commit | 15f9e7bb7c658ab20fb217572e03b7d53faac894 (patch) | |
tree | 00845693672d975dfb0ead0625eefd00a982bc4d /doc | |
parent | af793271bf225406c3f879e43072b6572914e62b (diff) | |
download | dbus-15f9e7bb7c658ab20fb217572e03b7d53faac894.tar.gz |
Describe quoting for match rules
I wish I could say "I can't believe this was never documented", but
it wouldn't be true.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24307
Reviewed-by: Alban Crequy
Diffstat (limited to 'doc')
-rw-r--r-- | doc/dbus-specification.xml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/dbus-specification.xml b/doc/dbus-specification.xml index a110a083..1830966f 100644 --- a/doc/dbus-specification.xml +++ b/doc/dbus-specification.xml @@ -4559,6 +4559,32 @@ "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='Foo',path='/bar/foo',destination=':452345.34',arg2='bar'" </para> <para> + Within single quotes (ASCII apostrophe, U+0027), a backslash + (U+005C) represents itself, and an apostrophe ends the quoted + section. Outside single quotes, \' (backslash, apostrophe) + represents an apostrophe, and any backslash not followed by + an apostrophe represents itself. For instance, the match rules + <literal>arg0=''\''',arg1='\',arg2=',',arg3='\\'</literal> and + <literal>arg0=\',arg1=\,arg2=',',arg3=\\</literal> + both match messages where the arguments are a 1-character string + containing an apostrophe, a 1-character string containing a + backslash, a 1-character string containing a comma, and a + 2-character string containing two backslashes<footnote> + <para> + This idiosyncratic quoting style is based on the rules for + escaping items to appear inside single-quoted strings + in POSIX <literal>/bin/sh</literal>, but please + note that backslashes that are not inside single quotes have + different behaviour. This syntax does not offer any way to + represent an apostrophe inside single quotes (it is necessary + to leave the single-quoted section, backslash-escape the + apostrophe and re-enter single quotes), or to represent a + comma outside single quotes (it is necessary to wrap it in + a single-quoted section). + </para> + </footnote>. + </para> + <para> The following table describes the keys that can be used to create a match rule. <informaltable> |