Content-Length: 293913 | pFad | http://github.com/postgrespro/postgres_cluster/commit/92d77c69e56579fb55126cd82e92eddf93774dad

45 Fix line count error reporting in config files, like pg_hba.conf, per · postgrespro/postgres_cluster@92d77c6 · GitHub
Skip to content

Commit 92d77c6

Browse files
committed
Fix line count error reporting in config files, like pg_hba.conf, per
report from Oliver Elphick. Backpatch to 7.3.
1 parent d9d59ca commit 92d77c6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/backend/libpq/hba.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.90 2002/12/06 04:37:02 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.91 2002/12/11 22:17:11 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -93,6 +93,7 @@ void
9393
next_token(FILE *fp, char *buf, const int bufsz)
9494
{
9595
int c;
96+
char *start_buf = buf;
9697
char *end_buf = buf + (bufsz - 1);
9798
bool in_quote = false;
9899
bool was_quote = false;
@@ -115,7 +116,10 @@ next_token(FILE *fp, char *buf, const int bufsz)
115116
{
116117
while ((c = getc(fp)) != EOF && c != '\n')
117118
;
118-
continue;
119+
/* If only comment, consume EOL too; return EOL */
120+
if (c != EOF && buf == start_buf)
121+
c = getc(fp);
122+
break;
119123
}
120124

121125
if (buf >= end_buf)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/92d77c69e56579fb55126cd82e92eddf93774dad

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy