[Xfce4-commits] <xfce4-mount-plugin:master> correct suport of netwrk filesystem on BSD due to wrong formulation of if-condition

Fabian noreply at xfce.org
Mon May 14 15:04:01 CEST 2012


Updating branch refs/heads/master
         to 4886b33d4fb2394fc158e9ad34997af67cac759b (commit)
       from 3acbad82f316607b05f5921c5fa33e8b1c413aea (commit)

commit 4886b33d4fb2394fc158e9ad34997af67cac759b
Author: Fabian <timystery at arcor.de>
Date:   Mon May 14 14:44:38 2012 +0200

    correct suport of netwrk filesystem on BSD due to wrong formulation of if-condition

 panel-plugin/devices.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/panel-plugin/devices.c b/panel-plugin/devices.c
index afa954e..f320895 100644
--- a/panel-plugin/devices.c
+++ b/panel-plugin/devices.c
@@ -184,7 +184,7 @@ shorten_disk_name (const char *dev, gint len)
 {
     char *r, *lastchars, *firstchars;
     //if (strncmp(dev, "UUID", 4)==0 && 
-    if (strlen(dev)>len+3)
+    if (strlen(dev)>len) // len canot be set lower than 9
     {
         // we want at least 5 characters at the end so that trimmed UUIDs are still readable
         lastchars = (char *) (dev + strlen(dev) - 5);
@@ -655,18 +655,20 @@ disks_refresh(GPtrArray * pdisks, GPtrArray *excluded_FSs, gint length)
               g_ascii_strcasecmp(pmntent->mnt_dir, "none") == 0 ||
               g_str_has_prefix(pmntent->mnt_fsname, "gvfs-fuse-daemon") ||
               !(g_str_has_prefix(pmntent->mnt_fsname, "/dev/") ||
-              g_str_has_prefix(pmntent->mnt_type, "fuse") ||
-              g_str_has_prefix(pmntent->mnt_type, "nfs") ||
-              g_str_has_prefix(pmntent->mnt_type, "smbfs") ||
-              g_str_has_prefix(pmntent->mnt_type, "cifs") ||
-              g_str_has_prefix(pmntent->mnt_type, "shfs") ) ||
+                g_str_has_prefix(pmntent->mnt_type, "fuse") ||
+                g_str_has_prefix(pmntent->mnt_type, "nfs") ||
+                g_str_has_prefix(pmntent->mnt_type, "smbfs") ||
+                g_str_has_prefix(pmntent->mnt_type, "cifs") ||
+                g_str_has_prefix(pmntent->mnt_type, "shfs") 
+              ) ||
               g_str_has_prefix(pmntent->mnt_dir, "/sys/")
 #elif defined (HAVE_GETMNTINFO)
               /* TODO: add support for more fs types on BSD */
               g_ascii_strcasecmp(pstatfs[i].f_mntonname, "none") == 0 ||
-              !g_str_has_prefix(pstatfs[i].f_mntfromname, "/dev/") ||
-              g_str_has_prefix(pstatfs[i].f_fstypename, "nfs") ||
-              g_str_has_prefix(pstatfs[i].f_fstypename, "mfs")
+              !(g_str_has_prefix(pstatfs[i].f_mntfromname, "/dev/") ||
+                g_str_has_prefix(pstatfs[i].f_fstypename, "nfs") ||
+                g_str_has_prefix(pstatfs[i].f_fstypename, "mfs")
+              )
 #endif
             ) continue;
 
@@ -717,7 +719,7 @@ disk_classify (char *device, char *mountpoint)
             dc = REMOTE;
         }
     }
-    else if ( strstr(device, "cdrom") || strstr(device, "cdrw") || strstr(device, "cd")
+    else if ( strstr(device, "cdrom") || strstr(device, "cdrw") 
                 || strstr(device, "dvd") || strstr(mountpoint, "cdrom")
                 || strstr(mountpoint, "cdrw") || strstr(mountpoint, "dvd")) {
         dc = CD_DVD;


More information about the Xfce4-commits mailing list