Skip to content

Commit b060c87

Browse files
committed
Treat EOF like \n for line-counting purposes in ParseConfigFile,
per bug #4752. Fujii Masao
1 parent 03cd757 commit b060c87

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/backend/utils/misc/guc-file.l

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (c) 2000-2009, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.58 2009/01/01 17:23:53 momjian Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.59 2009/04/09 14:21:02 tgl Exp $
88
*/
99

1010
%{
@@ -446,8 +446,13 @@ ParseConfigFile(const char *config_file, const char *calling_file,
446446

447447
/* now we'd like an end of line, or possibly EOF */
448448
token = yylex();
449-
if (token != GUC_EOL && token != 0)
450-
goto parse_error;
449+
if (token != GUC_EOL)
450+
{
451+
if (token != 0)
452+
goto parse_error;
453+
/* treat EOF like \n for line numbering purposes, cf bug 4752 */
454+
ConfigFileLineno++;
455+
}
451456

452457
/* OK, process the option name and value */
453458
if (guc_name_compare(opt_name, "include") == 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy