[gvfs/wip/udisks2] udisks2: URI unescape mount options read from /etc/fstab



commit 0d47c8cf3b15a5787f569ec3326836038d20d880
Author: David Zeuthen <davidz redhat com>
Date:   Tue Oct 4 08:27:46 2011 -0400

    udisks2: URI unescape mount options read from /etc/fstab
    
    For example, if the /etc/fstab file contains this line
    
     defaults,users,comment=gvfs.name=Photos%2C%20Media%20and%20Stuff,comment=gvfs.icon_name=folder-videos
    
    then this call
    
     lookup_mount_option_value(mount_point, "comment=gvfs.name=")
    
    will return the string
    
     'Photos, Media and Stuff'
    
    as expected.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=660536#c11 for details.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 monitor/udisks2/gvfsudisks2volume.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2volume.c b/monitor/udisks2/gvfsudisks2volume.c
index 94e686c..1f48d75 100644
--- a/monitor/udisks2/gvfsudisks2volume.c
+++ b/monitor/udisks2/gvfsudisks2volume.c
@@ -162,8 +162,8 @@ lookup_mount_option_value (GUnixMountPoint *mount_point,
           start += strlen (key);
           for (n = 0; start[n] != ',' && start[n] != '\0'; n++)
             ;
-          if (n > 01)
-            ret = g_strndup (start, n);
+          if (n > 1)
+            ret = g_uri_unescape_segment (start, start + n, NULL);
         }
     }
   return ret;



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