summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes2003-05-13 11:29:14 +0000
committerMichael Meskes2003-05-13 11:29:14 +0000
commit72f311b86a50f5e75536db6a0e1b0eaca6baeb4a (patch)
tree21f9368065d28304022701d24ba9ad9d85570bf6
parent1c9ac7dfd032b3e75067cf9dad1e6731e2ae0078 (diff)
Fixed order of include file search path.
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/preproc/ecpg.c27
2 files changed, 21 insertions, 10 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 14adf03b319..429af1cd88e 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1404,6 +1404,10 @@ Fri May 2 16:37:06 CEST 2003
Tue May 6 11:51:33 CEST 2003
- Added rfmtlong compatibility function.
+
+Tue May 13 13:34:12 CEST 2003
+
+ - Fixed order of include search path.
- Set ecpg version to 2.12.0.
- Set ecpg library to 3.4.2.
- Set pgtypes library to 1.0.0
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c
index cd9f319fb54..6dfdac82719 100644
--- a/src/interfaces/ecpg/preproc/ecpg.c
+++ b/src/interfaces/ecpg/preproc/ecpg.c
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.68 2003/05/02 14:43:25 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.69 2003/05/13 11:29:14 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <[email protected]> Feb 5th, 1998 */
@@ -61,12 +61,19 @@ help(const char *progname)
static void
add_include_path(char *path)
{
- struct _include_path *ip = include_paths;
+ struct _include_path *ip = include_paths, *new;
- include_paths = mm_alloc(sizeof(struct _include_path));
- include_paths->path = path;
- include_paths->next = ip;
+ new = mm_alloc(sizeof(struct _include_path));
+ new->path = path;
+ new->next = NULL;
+ if (ip == NULL)
+ include_paths = new;
+ else
+ {
+ for (;ip->next != NULL; ip=ip->next);
+ ip->next = new;
+ }
}
static void
@@ -125,11 +132,6 @@ main(int argc, char *const argv[])
}
}
- add_include_path("/usr/include");
- add_include_path(INCLUDE_PATH);
- add_include_path("/usr/local/include");
- add_include_path(".");
-
while ((c = getopt(argc, argv, "vcio:I:tD:dC:")) != -1)
{
switch (c)
@@ -187,6 +189,11 @@ main(int argc, char *const argv[])
}
}
+ add_include_path(".");
+ add_include_path("/usr/local/include");
+ add_include_path(INCLUDE_PATH);
+ add_include_path("/usr/include");
+
if (verbose)
{
fprintf(stderr, "%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n",