[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gcmd-dev] [PATCH] Switching to mounted device with mount point cont
Re: [gcmd-dev] [PATCH] Switching to mounted device with mount point containing spaces
Thu, 08 Nov 2007 23:13:10 +0100
> One small fix for switching device, which is mounted to path with
> spaces. This is case with memory cards formatted 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)
> gchar *dir = g_strcompress(v);
> if (strcmp (dir, dev_con->priv->mountp) == 0)
> ret = TRUE;
> g_strfreev (v);
> if (ret) break;
Thanks, applied. Works like a charm. I've slightly rearranged the code,
and fixed the missing fclose(fd)
> May be, the same should be aplied to mounting in do_mount_thread_func?
> May be not - i have not checked.
No, rather not, for do_mount_thread_func doesn't deal directly with
> 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.
Applied, although it's a hack only. IMHO the right solution is to use
to define gnome_cmd_..._get_type() functions in all gcmd files. But, of
course, this requires LOTS of work that will only kill some build