[glib] gapplication-tool: ensure object paths are valid



commit 9fe9a676a452a73daccdb46246575c4a4c97ee16
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 9 18:07:38 2014 -0700

    gapplication-tool: ensure object paths are valid
    
    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 |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gio/gapplication-tool.c b/gio/gapplication-tool.c
index fb5678c..9f6f8d1 100644
--- a/gio/gapplication-tool.c
+++ b/gio/gapplication-tool.c
@@ -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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]