Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit091a765

Browse files
committed
Don't refer to odbcinst.ini by absolute path. SQLGetPrivateProfileString
handles this.Don't install our own odbcinst.ini. That's the driver manager's business.
1 parentbb2bf2d commit091a765

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

‎src/interfaces/odbc/GNUmakefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# GNUMakefile for psqlodbc (Postgres ODBC driver)
44
#
5-
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.20 2001/09/22 22:54:32 petere Exp $
5+
# $Header: /cvsroot/pgsql/src/interfaces/odbc/Attic/GNUmakefile,v 1.21 2001/09/23 13:32:24 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -19,7 +19,7 @@ endif
1919
SO_MAJOR_VERSION = 0
2020
SO_MINOR_VERSION = 27
2121

22-
overrideCPPFLAGS := -I$(srcdir)$(CPPFLAGS) -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
22+
overrideCPPFLAGS := -I$(srcdir)$(CPPFLAGS)
2323

2424

2525
OBJS = info.o bind.o columninfo.o connection.o convert.o drvconn.o\
@@ -40,6 +40,7 @@ SHLIB_LINK += -liodbcinst
4040
endif
4141
ifeq ($(with_unixodbc)$(with_iodbc),nono)
4242
OBJS += gpps.o
43+
overrideCPPFLAGS += -DODBCINSTDIR='"$(odbcinst_ini_dir)"'
4344
endif
4445

4546
all: all-lib
@@ -54,16 +55,14 @@ LINK.shared += $(shlib_symbolic)
5455

5556

5657
install: all installdirs
57-
$(INSTALL_DATA)$(srcdir)/odbcinst.ini$(DESTDIR)$(odbcinst_ini_dir)/odbcinst.ini
5858
$(INSTALL_DATA)$(srcdir)/odbc.sql$(DESTDIR)$(datadir)/odbc.sql
5959
$(MAKE) install-lib
6060

6161
installdirs:
62-
$(mkinstalldirs)$(DESTDIR)$(libdir)$(DESTDIR)$(odbcinst_ini_dir)$(DESTDIR)$(datadir)
62+
$(mkinstalldirs)$(DESTDIR)$(libdir)$(DESTDIR)$(datadir)
6363

6464
uninstall: uninstall-lib
6565
rm -f$(DESTDIR)$(datadir)/odbc.sql
66-
# XXX Uninstall the .ini file as well?
6766

6867
cleandistcleanmaintainer-clean: clean-lib
6968
rm -f$(OBJS)

‎src/interfaces/odbc/dlg_specific.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,14 @@
2222
#defineUNKNOWNS_AS_DONTKNOW1
2323
#defineUNKNOWNS_AS_LONGEST2
2424

25-
/*INI File Stuff */
25+
/*ODBC initialization files */
2626
#ifndefWIN32
2727
#defineODBC_INI".odbc.ini"
28-
#ifdefODBCINSTDIR
29-
#defineODBCINST_INIODBCINSTDIR "/odbcinst.ini"
28+
#defineODBCINST_INI"odbcinst.ini"
3029
#else
31-
#defineODBCINST_INI"/etc/odbcinst.ini"
30+
#defineODBC_INI"ODBC.INI"
31+
#defineODBCINST_INI"ODBCINST.INI"
3232
#endif
33-
#else/* WIN32 */
34-
#defineODBC_INI"ODBC.INI"/* ODBC initialization
35-
* file */
36-
#defineODBCINST_INI"ODBCINST.INI"/* ODBC Installation
37-
* file */
38-
#endif/* WIN32 */
3933

4034

4135
#defineINI_DSNDBMS_NAME/* Name of default

‎src/interfaces/odbc/gpps.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@
4343
#defineFALSE((BOOL)0)
4444
#endif
4545

46+
#ifndefODBCINSTDIR
47+
#error "ODBCINSTDIR must be defined to compile this file"
48+
#endif
49+
4650

4751
/*
4852
* theIniFileName is searched for in:
4953
* $HOME/theIniFileName
5054
* theIniFileName
51-
* ODBCINST_INI
55+
*ODBCINSTDIR/ODBCINST_INI
5256
*/
5357
DWORD
5458
GetPrivateProfileString(constchar*theSection,/* section name */
@@ -102,7 +106,7 @@ GetPrivateProfileString(const char *theSection,/* section name */
102106
{
103107
aFile= (FILE*)fopen(theIniFileName,PG_BINARY_R);
104108
if (!aFile)
105-
aFile= (FILE*)fopen(ODBCINST_INI,PG_BINARY_R);
109+
aFile= (FILE*)fopen(ODBCINSTDIR"/"ODBCINST_INI,PG_BINARY_R);
106110
}
107111

108112
aLength= (theDefault==NULL) ?0 :strlen(theDefault);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp