Nikolay Sivov : oledb32: Support quoted values in initialisation strings.
Alexandre Julliard
julliard at winehq.org
Fri Oct 7 15:09:14 CDT 2016
Module: wine
Branch: stable
Commit: 2a88eb97161901535c06c0384b53b0bf74bd4eaf
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2a88eb97161901535c06c0384b53b0bf74bd4eaf
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Aug 9 10:36:22 2016 +0300
oledb32: Support quoted values in initialisation strings.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 85c6afe4cec71a26dbfce7c6ac8d66205a2deb43)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/oledb32/datainit.c | 24 ++++++++++++++++++++----
dlls/oledb32/tests/database.c | 4 ++++
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c
index 1ba0cb1..42d5dae 100644
--- a/dlls/oledb32/datainit.c
+++ b/dlls/oledb32/datainit.c
@@ -401,17 +401,33 @@ static HRESULT parse_init_string(const WCHAR *initstring, struct dbprops *props)
while (start && (eq = strchrW(start, '=')))
{
static const WCHAR providerW[] = {'P','r','o','v','i','d','e','r',0};
- WCHAR *scol = strchrW(eq+1, ';');
BSTR value, name;
+ WCHAR *delim;
name = SysAllocStringLen(start, eq - start);
/* skip equal sign to get value */
eq++;
- value = SysAllocStringLen(eq, scol ? scol - eq : -1);
+
+ if (*eq == '"')
+ {
+ /* for quoted value string, skip opening mark, look for terminating one */
+ eq++;
+ delim = strchrW(eq, '"');
+ }
+ else
+ delim = strchrW(eq, ';');
+
+ value = SysAllocStringLen(eq, delim ? delim - eq : -1);
/* skip semicolon if present */
- if (scol) scol++;
- start = scol;
+ if (delim)
+ {
+ if (*delim == '"')
+ delim++;
+ if (*delim == ';')
+ delim++;
+ }
+ start = delim;
if (!strcmpiW(name, providerW))
{
diff --git a/dlls/oledb32/tests/database.c b/dlls/oledb32/tests/database.c
index 483454e..8c531e4 100644
--- a/dlls/oledb32/tests/database.c
+++ b/dlls/oledb32/tests/database.c
@@ -291,6 +291,9 @@ static void test_database(void)
static WCHAR initstring_lower[] = {'d','a','t','a',' ','s','o','u','r','c','e','=','d','u','m','m','y',';',0};
static WCHAR customprop[] = {'d','a','t','a',' ','s','o','u','r','c','e','=','d','u','m','m','y',';',
'c','u','s','t','o','m','p','r','o','p','=','1','2','3','.','4',';',0};
+ static WCHAR extended_prop[] = {'d','a','t','a',' ','s','o','u','r','c','e','=','d','u','m','m','y',';',
+ 'E','x','t','e','n','d','e','d',' ','P','r','o','p','e','r','t','i','e','s','=','\"','D','R','I','V','E','R','=','A',
+ ' ','W','i','n','e',' ','O','D','B','C',' ','d','r','i','v','e','r',';','U','I','D','=','w','i','n','e',';','\"',';',0};
IDataInitialize *datainit = NULL;
HRESULT hr;
@@ -307,6 +310,7 @@ static void test_database(void)
test_GetDataSource(initstring_default);
test_GetDataSource(initstring_lower);
test_GetDataSource2(customprop);
+ test_GetDataSource2(extended_prop);
}
static void test_errorinfo(void)
More information about the wine-cvs
mailing list