[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH] Replace / with : in ConnectionString
From:       Florian Manschwetus <manschwetus () cs-software-gmbh ! de>
Date:       2022-03-31 18:05:31
Message-ID: 20220331180531.1873-1-manschwetus () cs-software-gmbh ! de
[Download RAW message or body]

From: manschwetusCS <30724946+manschwetusCS@users.noreply.github.com>

In Windows ODBC it seems to be legal to use "host/port", which is not legal with \
Linux ODBC. This patch aims to find and replace such in the ConnectionString

Signed-off-by: Florian Manschwetus <manschwetus@cs-software-gmbh.de>
---
 dlls/odbc32/proxyodbc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c
index c1cb44c29fc..3c78d94b69a 100644
--- a/dlls/odbc32/proxyodbc.c
+++ b/dlls/odbc32/proxyodbc.c
@@ -1779,10 +1779,21 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, \
                SQLCHAR *Connectio
                                   SQLCHAR *conn_str_out, SQLSMALLINT \
                conn_str_out_max,
                                   SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT \
driver_completion)  {
+    static const char *serverStr="SERVER=";
     struct SQLDriverConnect_params params = { hdbc, hwnd, ConnectionString, Length, \
                conn_str_out,
                                               conn_str_out_max, ptr_conn_str_out, \
driver_completion };  SQLRETURN ret;

+    SQLCHAR *serverPos;
+    for (serverPos = strstr(ConnectionString,serverStr);(*serverPos != ';') && \
(*serverPos != '\0'); ++serverPos) +    {
+        if (*serverPos == '/')
+        {
+           *serverPos = ':';
+           break;
+        }
+    }
+
     TRACE("(hdbc %p, hwnd %p, ConnectionString %s, Length %d, conn_str_out %p, \
conn_str_out_max %d,"  " ptr_conn_str_out %p, driver_completion %d)\n", hdbc, hwnd,
           debugstr_an((const char *)ConnectionString, Length), Length, conn_str_out, \
                conn_str_out_max,
--
2.33.0.windows.2

If you received this email in error, please advise the sender (by return email or \
otherwise) immediately.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic