diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-25 03:08:03 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-10-25 03:08:03 +0000 |
| commit | 51f62d505e2aba66bf7870c7bd005cd32e7d0953 (patch) | |
| tree | 127e7cbbf6679dbc2e3cfd08786ab88a7a801f50 /src/interfaces/ecpg/preproc/pgc.l | |
| parent | 8a17ed63359325c567694fdd378e71803a53cc73 (diff) | |
| download | postgresql-51f62d505e2aba66bf7870c7bd005cd32e7d0953.tar.gz | |
Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the
system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really
convinced that there ought to be a configure-time test to set the
value, go right ahead ... but I think it's a waste of time.
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
| -rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index ed406c9dd9..d84144262e 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.45 1999/10/22 23:14:50 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.46 1999/10/25 03:07:59 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,11 +22,6 @@ #include "postgres.h" -#ifndef PATH_MAX -#include <sys/param.h> -#define PATH_MAX MAXPATHLEN -#endif - #include "miscadmin.h" #include "nodes/parsenodes.h" #include "nodes/pg_list.h" @@ -527,7 +522,7 @@ cppline {space}*#.*(\\{space}*\n)*\n* <incl>[^ \t\n]+ { /* got the include file name */ struct _yy_buffer *yb; struct _include_path *ip; - char inc_file[PATH_MAX]; + char inc_file[MAXPGPATH]; yb = mm_alloc(sizeof(struct _yy_buffer)); @@ -544,7 +539,7 @@ cppline {space}*#.*(\\{space}*\n)*\n* yyin = NULL; for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next) { - if (strlen(ip->path) + strlen(yytext) + 3 > PATH_MAX) + if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH) { fprintf(stderr, "Error: Path %s/%s is too long in line %d, skipping.\n", ip->path, yytext, yylineno); continue; |
