From 83628de1305f41936744651eefe8f9677655abd0 Mon Sep 17 00:00:00 2001
From: Dominic Sisneros <dsisnero@gmail.com>
Date: Wed, 12 May 2010 12:29:59 -0600
Subject: [PATCH] check for nil path when initializing using TSAnames

---
 do_oracle/ext/do_oracle/do_oracle.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/do_oracle/ext/do_oracle/do_oracle.c b/do_oracle/ext/do_oracle/do_oracle.c
index 1c76610..12715b7 100755
--- a/do_oracle/ext/do_oracle/do_oracle.c
+++ b/do_oracle/ext/do_oracle/do_oracle.c
@@ -578,8 +578,10 @@ static VALUE cConnection_initialize(VALUE self, VALUE uri) {
     port = StringValuePtr(r_port);
   }
   
-  r_path = rb_funcall(uri, rb_intern("path"), 0);
-  path = StringValuePtr(r_path);
+   r_path = rb_funcall(uri, rb_intern("path"), 0);
+  if ( Qnil != r_path && RSTRING_LEN(r_path) > 0) {
+    path = StringValuePtr(r_path);
+  }
 
   // If just host name is specified then use it as TNS names alias
   if ((r_host != Qnil && RSTRING_LEN(r_host) > 0) &&
-- 
1.7.0.2.msysgit.0

