From d3acdc8818450eb6baa1bd7ba3298f7dfa08701f Mon Sep 17 00:00:00 2001 From: Ludek Finstrle Date: Sat, 17 Dec 2005 21:05:44 +0000 Subject: added support for ; as delimiter for ConfigDSN --- setup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index dbb5074..2be6aec 100644 --- a/setup.c +++ b/setup.c @@ -345,7 +345,7 @@ ParseAttributes(LPCSTR lpszAttributes, LPSETUPDLG lpsetupdlg) else if (*lpsz == '=') break; /* Valid key found */ } - /* Determine the key's index in the key table (-1 if not found) */ + /* Determine the key */ cbKey = lpsz - lpszStart; if (cbKey < sizeof(aszKey)) { @@ -353,13 +353,15 @@ ParseAttributes(LPCSTR lpszAttributes, LPSETUPDLG lpsetupdlg) aszKey[cbKey] = '\0'; } - /* Locate end of key value */ + /* Locate end of key value - added support for delimiter ; */ lpszStart = ++lpsz; - for (; *lpsz; lpsz++) + for (; *lpsz && *lpsz != ';'; lpsz++) ; - /* lpsetupdlg->aAttr[iElement].fSupplied = TRUE; */ - _fmemcpy(value, lpszStart, MIN(lpsz - lpszStart + 1, MAXPGPATH)); + /* Determine the value */ + cbKey = MIN(lpsz - lpszStart, MAXPGPATH); + _fmemcpy(value, lpszStart, cbKey); + value[cbKey] = '\0'; mylog("aszKey='%s', value='%s'\n", aszKey, value); -- cgit v1.2.3