? .cvsignore
? mimedetect_use_magic.patch
Index: magic.mime
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimedetect/magic.mime,v
retrieving revision 1.1
diff -u -p -r1.1 magic.mime
--- magic.mime	5 Jan 2008 05:04:09 -0000	1.1
+++ magic.mime	9 May 2009 17:40:55 -0000
@@ -310,7 +310,7 @@
 # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
 0       string          \037\213        application/x-gzip
 
-0		string			PK\003\004		application/x-zip
+0		string			PK\003\004		application/zip
 
 # RAR archiver (Greg Roelofs, newt@uchicago.edu)
 0	string		Rar!		application/x-rar
@@ -899,10 +899,10 @@
 >24		string	@		application/octet-stream
 
 0		string	MZ
->30		string	Copyright\ 1989-1990\ PKWARE\ Inc.	application/x-zip
+>30		string	Copyright\ 1989-1990\ PKWARE\ Inc.	application/zip
 
 0		string	MZ
->30		string	PKLITE\ Copr.	application/x-zip
+>30		string	PKLITE\ Copr.	application/zip
 
 0		string	MZ
 >36		string	LHa's\ SFX	application/x-lha
Index: mimedetect.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/mimedetect/mimedetect.module,v
retrieving revision 1.11
diff -u -p -r1.11 mimedetect.module
--- mimedetect.module	15 Apr 2009 20:28:25 -0000	1.11
+++ mimedetect.module	9 May 2009 17:40:55 -0000
@@ -53,11 +53,12 @@ function mimedetect_mime($file) {
   );
 
   $mime = FALSE;
+  $magic_file = drupal_get_path('module', 'mimedetect') . '/magic';
 
   // Try to use the fileinfo extension first.
   if (extension_loaded('fileinfo')) {
     static $finfo = FALSE;
-    if ($finfo || $finfo = @finfo_open(FILEINFO_MIME, drupal_get_path('module', 'mimedetect') . '/magic')) {
+    if ($finfo || $finfo = @finfo_open(FILEINFO_MIME, $magic_file)) {
       $mime = finfo_file($finfo, realpath($file->filepath));
     }
   }
@@ -70,8 +71,8 @@ function mimedetect_mime($file) {
     // On OSX the -i switch is -I, so if we use the long flags everyone is
     // happy. I checked back to version 3.41 and it still supports the long
     // names but if you run into problems you can use " -bi ".
-    $command = $filebin . ' --brief --mime ' . escapeshellarg($file->filepath);
-    $mime = trim(exec($command, $out));
+    $command = $filebin . ' --brief --mime --magic-file=' . escapeshellarg($magic_file) . ' ' . escapeshellarg($file->filepath);
+    $mime = trim(exec($command));
     // with text we often get charset like 'text/plain; charset=us-ascii'
     $mime = split(';', $mime);
     $mime = trim($mime[0]);
