[gnome-builder/wip/gtk4-port: 1508/1774] plugins/buildui: use teletype for argv




commit 4ed7f98d1047ff7b6208313f17e85f8030bde222
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 14 13:13:05 2022 -0700

    plugins/buildui: use teletype for argv
    
    This is a shell argument vector, so make it look more shell'y.

 src/plugins/buildui/gbp-buildui-runnables-dialog.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/buildui/gbp-buildui-runnables-dialog.c 
b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
index 9b8e96399..d73bcf3ff 100644
--- a/src/plugins/buildui/gbp-buildui-runnables-dialog.c
+++ b/src/plugins/buildui/gbp-buildui-runnables-dialog.c
@@ -71,12 +71,13 @@ create_run_command_row (gpointer item,
 
   if (argv != NULL)
     {
-      subtitle = g_string_new (NULL);
+      subtitle = g_string_new ("<tt>");
 
       for (guint i = 0; argv[i]; i++)
         {
           const char *arg = argv[i];
           g_autofree char *quote = NULL;
+          g_autofree char *arg_escaped = NULL;
 
           if (i > 0)
             g_string_append_c (subtitle, ' ');
@@ -93,11 +94,15 @@ create_run_command_row (gpointer item,
                 }
             }
 
-          if (quote)
-            g_string_append (subtitle, quote);
+          if (quote != NULL)
+            arg_escaped = g_markup_escape_text (quote, -1);
           else
-            g_string_append (subtitle, arg);
+            arg_escaped = g_markup_escape_text (arg, -1);
+
+          g_string_append (subtitle, arg_escaped);
         }
+
+      g_string_append (subtitle, "</tt>");
     }
 
   check = g_object_new (GTK_TYPE_CHECK_BUTTON,


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