diff options
| author | Marc G. Fournier <scrappy@hub.org> | 1999-01-31 19:56:28 +0000 |
|---|---|---|
| committer | Marc G. Fournier <scrappy@hub.org> | 1999-01-31 19:56:28 +0000 |
| commit | 91fed81c7762a56c536ce65ab8fd52bd8449a8e7 (patch) | |
| tree | 73f110da1f8b5f755a83582fb1d1e84b8f1227ef /src/interfaces/ecpg/preproc/pgc.l | |
| parent | f7c4ec5085b1fe2ae9e5d924702a502748c41acc (diff) | |
| download | postgresql-91fed81c7762a56c536ce65ab8fd52bd8449a8e7.tar.gz | |
From: Michael Meskes <Michael.Meskes@usa.net>
+
+ Wed Jan 27 12:42:22 CET 1999
+
+ - Fixed bug that caused ecpg to lose 'goto' information.
+ - Set ecpg version to 2.4.7
+
+ Fri Jan 29 18:03:52 CET 1999
+
+ - Fixed bug that caused 'enum' to be rejected in pure C code.
+ - Fixed bug that caused function names to be translated to lower case.
+ - Set ecpg version to 2.4.8
+
Diffstat (limited to 'src/interfaces/ecpg/preproc/pgc.l')
| -rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 2af1e3e522..e6ef819a59 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -333,22 +333,23 @@ cppline {space}*#.*(\\{space}*\n)*\n* <SQL>{identifier}/{space}*-{number} { int i; ScanKeyword *keyword; + char lower_text[NAMEDATALEN]; BEGIN(xm); - for(i = 0; yytext[i]; i++) - if (isascii((unsigned char)yytext[i]) && isupper(yytext[i])) - yytext[i] = tolower(yytext[i]); - - if (i >= NAMEDATALEN) - yytext[NAMEDATALEN-1] = '\0'; - - keyword = ScanKeywordLookup((char*)yytext); + /* this should leave the last byte set to '\0' */ + strncpy(lower_text, yytext, NAMEDATALEN-1); + for(i = 0; lower_text[i]; i++) + if (isascii((unsigned char)lower_text[i]) && isupper(lower_text[i])) + lower_text[i] = tolower(lower_text[i]); + +printf("yyt= %s, lt = %s\n", yytext, lower_text); + keyword = ScanKeywordLookup((char*)lower_text); if (keyword != NULL) { return keyword->value; } else { - keyword = ScanECPGKeywordLookup((char*)yytext); + keyword = ScanECPGKeywordLookup((char*)lower_text); if (keyword != NULL) { return keyword->value; } @@ -475,21 +476,22 @@ cppline {space}*#.*(\\{space}*\n)*\n* <SQL>{identifier} { int i; ScanKeyword *keyword; + char lower_text[NAMEDATALEN]; - for(i = 0; yytext[i]; i++) - if (isascii((unsigned char)yytext[i]) && isupper(yytext[i])) - yytext[i] = tolower(yytext[i]); - - if (i >= NAMEDATALEN) - yytext[NAMEDATALEN-1] = '\0'; + /* this should leave the last byte set to '\0' */ + strncpy(lower_text, yytext, NAMEDATALEN-1); + for(i = 0; lower_text[i]; i++) + if (isascii((unsigned char)lower_text[i]) && isupper(lower_text[i])) + lower_text[i] = tolower(lower_text[i]); - keyword = ScanKeywordLookup((char*)yytext); +printf("yyt= %s, lt = %s\n", yytext, lower_text); + keyword = ScanKeywordLookup((char*)lower_text); if (keyword != NULL) { return keyword->value; } else { - keyword = ScanECPGKeywordLookup((char*)yytext); + keyword = ScanECPGKeywordLookup((char*)lower_text); if (keyword != NULL) { return keyword->value; } |
