summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-08 04:26:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-08 04:26:04 +0000
commit662d62340c405141c33143a4de69d40907fab642 (patch)
tree5bd9e68549d4988dfb83d03d585428e9f9002f4c
parentc29a3862265e260339cd25254f2f02ec057a3696 (diff)
Remove outside-the-scanner references to "yyleng".
It seems the flex developers have decided to change yyleng from int to size_t. This has already happened in the latest release of OS X, and will start happening elsewhere once the next release of flex appears. Rather than trying to divine how it's declared in any particular build, let's just remove the one existing not-very-necessary external usage. Back-patch to all supported branches; not so much because users in the field are likely to care about building old branches with cutting-edge flex, as to keep OSX-based buildfarm members from having problems with old branches.
-rw-r--r--src/interfaces/ecpg/preproc/extern.h3
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y8
2 files changed, 3 insertions, 8 deletions
diff --git a/src/interfaces/ecpg/preproc/extern.h b/src/interfaces/ecpg/preproc/extern.h
index 06cc74f2040..357967dadd4 100644
--- a/src/interfaces/ecpg/preproc/extern.h
+++ b/src/interfaces/ecpg/preproc/extern.h
@@ -30,8 +30,7 @@ extern char *yytext,
#ifdef YYDEBUG
extern int yydebug;
#endif
-extern int yylineno,
- yyleng;
+extern int yylineno;
extern FILE *yyin,
*yyout;
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index a975f03a675..73adf3bf0ae 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303.4.9 2008/10/10 12:19:18 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303.4.10 2009/09/08 04:26:04 tgl Exp $ */
/* Copyright comment */
%{
@@ -162,11 +162,7 @@ make3_str(char *str1, char *str2, char *str3)
static char *
make_name(void)
{
- char * name = (char *)mm_alloc(yyleng + 1);
-
- strncpy(name, yytext, yyleng);
- name[yyleng] = '\0';
- return(name);
+ return mm_strdup(yytext);
}
static char *