--- sql/oracle/parser3oracle.C 2004/10/07 09:27:02 1.65 +++ sql/oracle/parser3oracle.C 2004/12/23 16:54:52 1.67 @@ -8,7 +8,7 @@ 2001.07.30 using Oracle 8.1.6 [@test tested with Oracle 7.x.x] */ -static const char *RCSId="$Id: parser3oracle.C,v 1.65 2004/10/07 09:27:02 paf Exp $"; +static const char *RCSId="$Id: parser3oracle.C,v 1.67 2004/12/23 16:54:52 paf Exp $"; #include "config_includes.h" @@ -113,6 +113,17 @@ static char *lsplit(char **string_ref, c return result; } +static char* rsplit(char* string, char delim) { + if(string) { + char* v=strrchr(string, delim); + if(v) { + *v=0; + return v+1; + } + } + return NULL; +} + #ifndef DOXYGEN struct Connection { SQL_Driver_services *services; @@ -275,7 +286,7 @@ public: *connection_ref=&connection; char *user=url; - char *service=lsplit(user, '@'); + char *service=rsplit(user, '@'); char *pwd=lsplit(user, ':'); char *options=lsplit(service, '?'); @@ -506,6 +517,8 @@ public: value_buf=(char *)services.malloc_atomic(MAX_OUT_STRING_LENGTH+1/*terminator*/); if(value_length) memcpy(value_buf, ph.value, value_length+1); + else + value_buf[0]=0; char name_buf[MAX_STRING]; sb4 placeh_len=snprintf(name_buf, sizeof(name_buf), ":%s", ph.name);