From 56954a051f4d6512274b85e220bd1771be270da4 Mon Sep 17 00:00:00 2001
From: Nathaniel Talbott <nathaniel@talbott.ws>
Date: Sat, 16 Apr 2011 17:24:33 -0400
Subject: [PATCH] Fix for bundled BridgeSupport.

---
 bridgesupport.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/bridgesupport.cpp b/bridgesupport.cpp
index 2fa8843..72b5c90 100644
--- a/bridgesupport.cpp
+++ b/bridgesupport.cpp
@@ -1524,6 +1524,17 @@ Init_BridgeSupport(void)
 	stat("/System/Library/BridgeSupport/ruby-1.8/bridgesupportparser.bundle",
 		&s) == 0;
 
+    if (!bridgesupport_tot) {
+        CFBundleRef bundle = CFBundleGetMainBundle();
+        if (bundle != NULL) {
+            CFURLRef url = CFBundleCopyResourceURL(bundle, CFSTR("BridgeSupport"), NULL, NULL);
+            if (url != NULL) {
+                bridgesupport_tot = true;
+                CFRelease(url);
+            }
+        }
+    }
+
     // Boxed
     rb_cBoxed = rb_define_class("Boxed", rb_cObject);
     rb_objc_define_method(*(VALUE *)rb_cBoxed, "type",
-- 
1.7.1

