diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-10-11 11:57:49 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-10-11 11:57:49 +0200 |
commit | e64a4cb4f5529240d292a80903de2c85dd45ff95 (patch) | |
tree | 6229c6a5c16434ec680f343fcc99897fb36fea5e | |
parent | 2cef44a99ee4744580e97ecb6b37bd70dc3fe76a (diff) | |
download | gvfs-e64a4cb4f5529240d292a80903de2c85dd45ff95.tar.gz |
afp: Don't set a content-type that isn't certain
Don't ignore the result_uncertain flag from g_content_type_guess() as it
might cause nautilus to incorrectly think that a particular file is of a
certain type, and never check its magic.
-rw-r--r-- | daemon/gvfsafpserver.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c index d1787a47..a8eeb824 100644 --- a/daemon/gvfsafpserver.c +++ b/daemon/gvfsafpserver.c @@ -1608,10 +1608,12 @@ g_vfs_afp_server_fill_info (GVfsAfpServer *server, if (!directory) { char *content_type; + gboolean uncertain_content_type; GIcon *icon; - content_type = g_content_type_guess (utf8_name, NULL, 0, NULL); - g_file_info_set_content_type (info, content_type); + content_type = g_content_type_guess (utf8_name, NULL, 0, &uncertain_content_type); + if (!uncertain_content_type) + g_file_info_set_content_type (info, content_type); g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, content_type); |