diff options
| author | Colin Walters <walters@verbum.org> | 2010-02-01 10:09:53 -0500 |
|---|---|---|
| committer | Colin Walters <walters@verbum.org> | 2010-02-15 13:26:53 -0500 |
| commit | 9637ed9f0c66982a06048b18ccf983881643e456 (patch) | |
| tree | 90880057380d87a8a59d20e6a302c10d541fc26b | |
| parent | d039ca66f85955788e2d58294c249579bed9cc03 (diff) | |
Squash underscores and dashes in errors when converting to DBus errors
We were just taking the enumeration nick and appending to the DBus
error name, but since these can contain '-' we need to squash.
| -rw-r--r-- | dbus/dbus-gobject.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index f75a3b1..e61438c 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1093,9 +1093,18 @@ gerror_domaincode_to_dbus_error_name (const DBusGObjectInfo *object_info, } else { - dbus_error_name = g_string_new (domain_str); + char *domain_member, *code_member; + + /* TODO should further validate these */ + domain_member = uscore_to_wincaps (domain_str); + code_member = uscore_to_wincaps (code_str); + + dbus_error_name = g_string_new (domain_member); g_string_append_c (dbus_error_name, '.'); - g_string_append (dbus_error_name, code_str); + g_string_append (dbus_error_name, code_member); + + g_free (domain_member); + g_free (code_member); } return g_string_free (dbus_error_name, FALSE); |
