diff src/stdio/stdio.c @ 1935:c276e2b74646

Backed out changeset 31e9908cf91e It has been decided that using libmagic is a bad idea due to false positives.
author William Pitcock <nenolod@atheme.org>
date Mon, 01 Oct 2007 15:34:40 -0500
parents 31e9908cf91e
children 2ebeb7816c5e
line wrap: on
line diff
--- a/src/stdio/stdio.c	Sun Sep 30 11:44:20 2007 -0500
+++ b/src/stdio/stdio.c	Mon Oct 01 15:34:40 2007 -0500
@@ -27,8 +27,6 @@
 
 #include <string.h>
 
-#include <magic.h>
-
 static gchar *
 vfs_stdio_urldecode_path(const gchar * encoded_path)
 {
@@ -251,28 +249,6 @@
     return s.st_size;
 }
 
-static magic_t mdb_handle = NULL;
-
-gchar *
-stdio_vfs_metadata_impl(VFSFile *file, const gchar *field)
-{
-    if (!g_ascii_strcasecmp(field, "content-type"))
-    {
-        gchar *decpath;
-        const gchar *out;
-
-        if (mdb_handle == NULL)
-            mdb_handle = magic_open(MAGIC_MIME);
-
-        decpath = vfs_stdio_urldecode_path(file->uri);
-        out = magic_file(mdb_handle, decpath);
-
-        return g_strdup(out);
-    }
-
-    return NULL;
-}
-
 VFSConstructor file_const = {
 	"file://",
 	stdio_vfs_fopen_impl,
@@ -286,8 +262,7 @@
 	stdio_vfs_ftell_impl,
 	stdio_vfs_feof_impl,
 	stdio_vfs_truncate_impl,
-	stdio_vfs_fsize_impl,
-	stdio_vfs_metadata_impl
+	stdio_vfs_fsize_impl
 };
 
 static void init(void)