gapplication-tool: ensure object paths are valid
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 10 Apr 2014 01:07:38 +0000 (18:07 -0700)
committerCosimo Cecchi <cosimoc@gnome.org>
Thu, 10 Apr 2014 16:16:22 +0000 (09:16 -0700)
Hyphens are not valid characters for DBus object paths; see the similar
code in gapplicationimpl-dbus.c

https://bugzilla.gnome.org/show_bug.cgi?id=727928

gio/gapplication-tool.c

index fb5678c..9f6f8d1 100644 (file)
@@ -238,8 +238,12 @@ app_path_for_id (const gchar *app_id)
 
   path = g_strconcat ("/", app_id, NULL);
   for (i = 0; path[i]; i++)
-    if (path[i] == '.')
-      path[i] = '/';
+    {
+      if (path[i] == '.')
+        path[i] = '/';
+      if (path[i] == '-')
+        path[i] = '_';
+    }
 
   return path;
 }