[gtk/ebassi/for-master: 4/9] a11y: Add a fallback for the root base path




commit 6a02a93129b2f97d282305360801dd13b2037bb1
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Nov 19 14:24:47 2020 +0000

    a11y: Add a fallback for the root base path
    
    In case g_get_prgname() returns NULL, which seems to be the case for the
    GTK tests.

 gtk/a11y/gtkatspiroot.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/a11y/gtkatspiroot.c b/gtk/a11y/gtkatspiroot.c
index ca7730a018..48c9e60676 100644
--- a/gtk/a11y/gtkatspiroot.c
+++ b/gtk/a11y/gtkatspiroot.c
@@ -665,8 +665,10 @@ gtk_at_spi_root_constructed (GObject *gobject)
     }
   else
     {
+      const char *program_name = g_get_prgname ();
+
       self->base_path = g_strconcat ("/org/gtk/application/",
-                                     g_get_prgname (),
+                                     program_name != NULL ? program_name : "unknown",
                                      "/a11y",
                                      NULL);
 


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