Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 72f311b

Browse files
author
Michael Meskes
committed
Fixed order of include file search path.
1 parent 1c9ac7d commit 72f311b

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

src/interfaces/ecpg/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,10 @@ Fri May 2 16:37:06 CEST 2003
14041404
Tue May 6 11:51:33 CEST 2003
14051405

14061406
- Added rfmtlong compatibility function.
1407+
1408+
Tue May 13 13:34:12 CEST 2003
1409+
1410+
- Fixed order of include search path.
14071411
- Set ecpg version to 2.12.0.
14081412
- Set ecpg library to 3.4.2.
14091413
- Set pgtypes library to 1.0.0

src/interfaces/ecpg/preproc/ecpg.c

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.68 2003/05/02 14:43:25 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.69 2003/05/13 11:29:14 meskes Exp $ */
22

33
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
44
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
@@ -61,12 +61,19 @@ help(const char *progname)
6161
static void
6262
add_include_path(char *path)
6363
{
64-
struct _include_path *ip = include_paths;
64+
struct _include_path *ip = include_paths, *new;
6565

66-
include_paths = mm_alloc(sizeof(struct _include_path));
67-
include_paths->path = path;
68-
include_paths->next = ip;
66+
new = mm_alloc(sizeof(struct _include_path));
67+
new->path = path;
68+
new->next = NULL;
6969

70+
if (ip == NULL)
71+
include_paths = new;
72+
else
73+
{
74+
for (;ip->next != NULL; ip=ip->next);
75+
ip->next = new;
76+
}
7077
}
7178

7279
static void
@@ -125,11 +132,6 @@ main(int argc, char *const argv[])
125132
}
126133
}
127134

128-
add_include_path("/usr/include");
129-
add_include_path(INCLUDE_PATH);
130-
add_include_path("/usr/local/include");
131-
add_include_path(".");
132-
133135
while ((c = getopt(argc, argv, "vcio:I:tD:dC:")) != -1)
134136
{
135137
switch (c)
@@ -187,6 +189,11 @@ main(int argc, char *const argv[])
187189
}
188190
}
189191

192+
add_include_path(".");
193+
add_include_path("/usr/local/include");
194+
add_include_path(INCLUDE_PATH);
195+
add_include_path("/usr/include");
196+
190197
if (verbose)
191198
{
192199
fprintf(stderr, "%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n",

0 commit comments

Comments
 (0)