From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 2/2] tools: Fix mpris-player creating busname starting with digit
Date: Thu, 31 Jan 2013 09:33:55 -0600 [thread overview]
Message-ID: <1359646436-8113-6-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1359646436-8113-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
D-Bus does not allow a bus name starting with digits after . so the code
now prefix with bt_ if the device name starts with a digit.
---
tools/mpris-player.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/mpris-player.c b/tools/mpris-player.c
index b82b5df..4dbde90 100644
--- a/tools/mpris-player.c
+++ b/tools/mpris-player.c
@@ -1381,7 +1381,11 @@ static const GDBusPropertyTable mpris_properties[] = {
static char *mpris_busname(char *name)
{
- return g_strconcat(MPRIS_BUS_NAME,
+ if (g_ascii_isdigit(name[0]))
+ return g_strconcat(MPRIS_BUS_NAME, "bt_",
+ g_strcanon(name, A_Z a_z _0_9, '_'), NULL);
+ else
+ return g_strconcat(MPRIS_BUS_NAME,
g_strcanon(name, A_Z a_z _0_9, '_'), NULL);
}
--
1.8.1
next prev parent reply other threads:[~2013-01-31 15:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 1/2] tools: Use device Alias instead of Name Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 2/2 v2] attrib: Don't attempt to unregister event id 0 Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 2/3] hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue Luiz Augusto von Dentz
2013-01-31 15:33 ` Luiz Augusto von Dentz [this message]
2013-01-31 15:33 ` [PATCH BlueZ 3/3] hcidump: Fix parsing of SetBrowsedPlayer Luiz Augusto von Dentz
2013-01-31 22:07 ` [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Vinicius Costa Gomes
2013-01-31 23:03 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359646436-8113-6-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox