From 8ef97f789e132868423e920c06286707beadc6de Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sat, 30 Nov 2013 18:12:05 +0000 Subject: MTP: Fix compilation warning. https://bugzilla.gnome.org/show_bug.cgi?id=715119 --- diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c index 02059eb..12dba6c 100644 --- a/daemon/gvfsbackendmtp.c +++ b/daemon/gvfsbackendmtp.c @@ -1003,14 +1003,14 @@ do_query_info (GVfsBackend *backend, DEBUG ("(I) do_query_info (filename = %s) ", filename); g_mutex_lock (&G_VFS_BACKEND_MTP (backend)->mutex); - FAIL_DURING_UNMOUNT(); - gchar **elements = g_strsplit_set (filename, "/", -1); unsigned int ne = g_strv_length (elements); LIBMTP_mtpdevice_t *device; device = G_VFS_BACKEND_MTP (backend)->device; + FAIL_DURING_UNMOUNT(); + if (ne == 2 && elements[1][0] == '\0') { get_device_info (G_VFS_BACKEND_MTP (backend), info); } else if (ne < 3) { @@ -1425,11 +1425,11 @@ do_set_display_name (GVfsBackend *backend, DEBUG ("(I) do_set_display_name '%s' --> '%s' ", filename, display_name); g_mutex_lock (&G_VFS_BACKEND_MTP (backend)->mutex); - FAIL_DURING_UNMOUNT(); - gchar **elements = g_strsplit_set (filename, "/", -1); unsigned int ne = g_strv_length (elements); + FAIL_DURING_UNMOUNT(); + if (ne < 3) { g_vfs_job_failed_literal (G_VFS_JOB (job), G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, -- cgit v0.9.2