gcmd-devel
[Top][All Lists]
Advanced

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

[gcmd-dev] [PATCH] Switching to mounted device with mount point containi


From: Mike Crash
Subject: [gcmd-dev] [PATCH] Switching to mounted device with mount point containing spaces
Date: Wed, 07 Nov 2007 22:45:23 +0100
User-agent: Icedove 1.5.0.14pre (X11/20071025)

One small fix for switching device, which is mounted to path with spaces. This is case with memory cards formated in digital cameras, where the name of device is name of camera - for example "NIKON D40", which mounts in GNOME to "/media/NIKON D40" and in mtab is "/media/NIKON\040D40" with escape character. This should be converted to normal string with g_strcompress, so the function is_mounted in gnome-cmd-con-device.cc line 67 will contain:

-------------------------------------
   while ((s = fgets (tmp, sizeof(tmp), fd)))
   {
       char **v = g_strsplit (s, " ", 3);

       if (v[1])
       {
           gchar *dir = g_strcompress(v[1]);
           if (strcmp (dir, dev_con->priv->mountp) == 0)
               ret = TRUE;
           g_free(dir);
       }

       g_strfreev (v);

       if (ret) break;
   }
-------------------------------------

May be, the same should be aplied to mounting in do_mount_thread_func? May be not - i have not checked.

Also fix in gnome_cmd_con_device_get_type function automatic conversion of constant string "GnomeCmdConDevice" to (gchar*)"GnomeCmdConDevice" - this is deprecated from gcc4.2 and it will remove warning with gcc4.2. This is case with many other source files in gnome-commander and should be (slowly) fixed in future.

Mike






reply via email to

[Prev in Thread] Current Thread [Next in Thread]