--- libmagic.rb.orig	2013-07-30 00:49:48.000000000 +0100
+++ libmagic.rb.new	2013-07-30 00:49:24.000000000 +0100
@@ -12,7 +12,11 @@
 
   # Fixed upstream, should be in next release
   # See http://bugs.gw.com/view.php?id=230
-  def patches; DATA; end if MacOS.version < :lion
+  def patches
+    p = []
+    p << DATA if MacOS.version < :lion
+    p << 'https://gist.github.com/kwilczynski/6108866/raw/15d1f0a2dba5da23e820b503e8551346a4d235eb/file-5.14.diff'
+  end
 
   def install
     ENV.universal_binary if build.universal?

--- libmagic.rb.orig	2013-07-30 00:49:48.000000000 +0100
+++ libmagic.rb.new	2013-07-30 04:12:29.000000000 +0100
@@ -12,7 +12,13 @@
 
   # Fixed upstream, should be in next release
   # See http://bugs.gw.com/view.php?id=230
-  def patches; DATA; end if MacOS.version < :lion
+  def patches
+    p = []
+    p << DATA if MacOS.version < :lion
+    # Fixes generaly incorrect code, plus issues with certain
+    # versions of cpp. Not fixed in upstream yet.
+    p << 'https://gist.github.com/kwilczynski/6108866/raw/15d1f0a2dba5da23e820b503e8551346a4d235eb/file-5.14.diff'
+  end
 
   def install
     ENV.universal_binary if build.universal?

Add comment as per Homebrew guidelines.
Add comment as per Homebrew guidelines.

As per: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook#patches

Signed-off-by: Krzysztof Wilczynski <9bf091559fc98493329f7d619638c79e91ccf029@linux.com>
