$OpenBSD: patch-sqlreggetvalue_c,v 1.3 2003/06/03 01:26:50 margarida Exp $ --- sqlreggetvalue.c.orig Mon Dec 3 18:08:30 2001 +++ sqlreggetvalue.c Tue Jun 3 02:07:59 2003 @@ -22,7 +22,6 @@ #include "util.h" #include "constants.h" #include "sqldumplogins.h" -#include void usage(char **argv) { @@ -64,9 +63,16 @@ TDSLOGIN *set_target_defaults(TDSLOGIN * void doRegGetValue(TDSLOGIN *pLogin, char *pKey, char *pValue) { TDSSOCKET *pTds = NULL; + TDSCONTEXT *context = NULL; + TDSCONNECTINFO *connect_info; /* connect to the SQL server */ - if( (pTds = tds_connect(pLogin)) !=NULL ) { + context = tds_alloc_context(); + pTds = tds_alloc_socket(context, 512); + tds_set_parent(pTds, NULL); + connect_info = tds_read_config_info(NULL, pLogin, context->locale); + + if (!connect_info || tds_connect(pTds, connect_info) != TDS_FAIL) { fprintf(stderr, "SQLRegGetValue %s by \n", SQLTOOLS_VERSION); fprintf(stderr, "----------------------------------------------------" \