--- drush_1458416.patch	2012-02-28 14:03:13.371248204 -0800
+++ drush_1458416-11.patch	2012-02-29 13:51:57.899800447 -0800
@@ -1,24 +1,24 @@
-From 9cc4e0eba4855b50f40cf654e1d51c2da8c16fb7 Mon Sep 17 00:00:00 2001
+From 0412cf9ee2b3bc54056d37879861418a0df9996a Mon Sep 17 00:00:00 2001
 From: Adam J. DiCarlo <adam.dicarlo@gmail.com>
 Date: Tue, 28 Feb 2012 14:02:50 -0800
 Subject: [PATCH] Issue #1458416: Fix Fatal error: Call to undefined function mime_content_type().
 
 ---
- commands/make/make.download.inc |   84 +++++++++++++++++++++++++++++----------
- 1 files changed, 63 insertions(+), 21 deletions(-)
+ commands/make/make.download.inc |   81 +++++++++++++++++++++++++++++----------
+ 1 files changed, 60 insertions(+), 21 deletions(-)
 
 diff --git a/commands/make/make.download.inc b/commands/make/make.download.inc
-index 39870e5..b1aab43 100644
+index 39870e5..00cb5b9 100644
 --- a/commands/make/make.download.inc
 +++ b/commands/make/make.download.inc
-@@ -91,40 +91,82 @@ function _make_download_file($download) {
+@@ -91,40 +91,79 @@ function _make_download_file($download) {
  }
  
  /**
 + * Determines the MIME content type of the specified file. The power of this
 + * function depends on whether the PHP installation has either
 + * mime_content_type() or finfo installed -- if not, only tar, gz, and zip types
-+ * can be detected, and other file types will return 'application/octet-stream'.
++ * can be detected, and other file types will return 'unknown'.
 + *
 + * @return
 + *   The MIME content type of the file, 'unknown', or FALSE on error.
@@ -49,22 +49,19 @@ index 39870e5..b1aab43 100644
 +      return FALSE;
 +    }
 +
-+    $data = unpack('S', $first);
++    // Interpret the two bytes as a little endian 16-bit unsigned int.
++    $data = unpack('v', $first);
 +    switch ($data[1]) {
-+      // First two bytes of gzip files are 0x1f8b.
-+      case 0x1f8b:
++      // First two bytes of gzip files are 0x1f, 0x8b.
++      // See http://www.gzip.org/zlib/rfc-gzip.html#header-trailer.
 +      case 0x8b1f:
 +        return 'application/x-gzip';
 +
-+      // First two bytes of zip files are 0x504b ('PK')
-+      case 0x504b:
++      // First two bytes of zip files are 0x50, 0x4b ('PK').
++      // See http://en.wikipedia.org/wiki/Zip_(file_format)#File_headers.
 +      case 0x4b50:
 +        return 'application/zip';
 +
-+      // Couldn't read from file -- who knows what's happening.
-+      case FALSE:
-+        return FALSE;
-+
 +      // Not a file type we can detect.
 +      default:
 +        return 'unknown';
