[gnome-disk-utility/wip/kailueke/escape-mount-point] Escape hyperlink text in mount point label




commit 6af85e3bd9471361259bb20bb48e50ddb3e22167
Author: Kai Lüke <kailueke riseup net>
Date:   Mon Jun 28 23:22:09 2021 +0200

    Escape hyperlink text in mount point label
    
    Mount points with special characters broke the hyperlink assembling for
    the label.
    
    Escape the mount point string when assembling the label hyperlink.
    
    https://gitlab.gnome.org/GNOME/gnome-disk-utility/-/issues/216

 src/disks/gduwindow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index 12c3e477..5bf39e91 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -2542,8 +2542,11 @@ update_device_page_for_block (GduWindow          *window,
             }
           else
             {
+              gchar *escaped_mount_point;
+              escaped_mount_point = g_markup_escape_text (mount_points[0], -1);
               s = g_strdup_printf ("<a href=\"file://%s\">%s</a>",
-                                   mount_points[0], mount_points[0]);
+                                   escaped_mount_point, escaped_mount_point);
+              g_free (escaped_mount_point);
             }
           /* Translators: Shown as in-use part of 'Contents'. The first %s is the mount point, e.g. 
/media/foobar */
           in_use_markup = g_strdup_printf (C_("volume-content-fs", "Mounted at %s"), s);


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