Treat EOF like \n for line-counting purposes in ParseConfigFile,
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Apr 2009 14:21:02 +0000 (14:21 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 9 Apr 2009 14:21:02 +0000 (14:21 +0000)
per bug #4752.  Fujii Masao

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

index 354da1ceb460fe5c1fdb36b56158cc0c591e0ad2..9e9c3f7793950ce1503f731ef4459b04b9fe61ea 100644 (file)
@@ -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)