From: Tom Lane Date: Thu, 9 Apr 2009 14:21:02 +0000 (+0000) Subject: Treat EOF like \n for line-counting purposes in ParseConfigFile, X-Git-Url: http://git.postgresql.org/gitweb/static/session/index.html?a=commitdiff_plain;h=6c7a7bc80c5e36c7a95bc42b727c01bb7d817a3c;p=users%2Fsimon%2Fpostgres.git Treat EOF like \n for line-counting purposes in ParseConfigFile, per bug #4752. Fujii Masao --- diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 354da1ceb4..9e9c3f7793 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -446,8 +446,13 @@ ParseConfigFile(const char *config_file, const char *calling_file, /* now we'd like an end of line, or possibly EOF */ token = yylex(); - if (token != GUC_EOL && token != 0) - goto parse_error; + if (token != GUC_EOL) + { + if (token != 0) + goto parse_error; + /* treat EOF like \n for line numbering purposes, cf bug 4752 */ + ConfigFileLineno++; + } /* OK, process the option name and value */ if (guc_name_compare(opt_name, "include") == 0)