|
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 $ */ |
2 | 2 |
|
3 | 3 | /* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
|
4 | 4 | /* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
|
@@ -61,12 +61,19 @@ help(const char *progname)
|
61 | 61 | static void
|
62 | 62 | add_include_path(char *path)
|
63 | 63 | {
|
64 |
| - struct _include_path *ip = include_paths; |
| 64 | + struct _include_path *ip = include_paths, *new; |
65 | 65 |
|
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; |
69 | 69 |
|
| 70 | + if (ip == NULL) |
| 71 | + include_paths = new; |
| 72 | + else |
| 73 | + { |
| 74 | + for (;ip->next != NULL; ip=ip->next); |
| 75 | + ip->next = new; |
| 76 | + } |
70 | 77 | }
|
71 | 78 |
|
72 | 79 | static void
|
@@ -125,11 +132,6 @@ main(int argc, char *const argv[])
|
125 | 132 | }
|
126 | 133 | }
|
127 | 134 |
|
128 |
| - add_include_path("/usr/include"); |
129 |
| - add_include_path(INCLUDE_PATH); |
130 |
| - add_include_path("/usr/local/include"); |
131 |
| - add_include_path("."); |
132 |
| - |
133 | 135 | while ((c = getopt(argc, argv, "vcio:I:tD:dC:")) != -1)
|
134 | 136 | {
|
135 | 137 | switch (c)
|
@@ -187,6 +189,11 @@ main(int argc, char *const argv[])
|
187 | 189 | }
|
188 | 190 | }
|
189 | 191 |
|
| 192 | + add_include_path("."); |
| 193 | + add_include_path("/usr/local/include"); |
| 194 | + add_include_path(INCLUDE_PATH); |
| 195 | + add_include_path("/usr/include"); |
| 196 | + |
190 | 197 | if (verbose)
|
191 | 198 | {
|
192 | 199 | fprintf(stderr, "%s, the PostgreSQL embedded C preprocessor, version %d.%d.%d\n",
|
|
0 commit comments