projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1287c07
)
Fix line count error reporting in config files, like pg_hba.conf, per
author
Bruce Momjian
<
[email protected]
>
Wed, 11 Dec 2002 22:17:31 +0000
(22:17 +0000)
committer
Bruce Momjian
<
[email protected]
>
Wed, 11 Dec 2002 22:17:31 +0000
(22:17 +0000)
report from Oliver Elphick.
Backpatch to 7.3.
src/backend/libpq/hba.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/libpq/hba.c
b/src/backend/libpq/hba.c
index 2f9664cfd1867305ed37216694ce33ec2014875d..76e3d9a62caf04dbcabd6f02c0eabc69b475f4da 100644
(file)
--- a/
src/backend/libpq/hba.c
+++ b/
src/backend/libpq/hba.c
@@
-93,6
+93,7
@@
void
next_token(FILE *fp, char *buf, const int bufsz)
{
int c;
+ char *start_buf = buf;
char *end_buf = buf + (bufsz - 1);
bool in_quote = false;
bool was_quote = false;
@@
-115,7
+116,10
@@
next_token(FILE *fp, char *buf, const int bufsz)
{
while ((c = getc(fp)) != EOF && c != '\n')
;
- continue;
+ /* If only comment, consume EOL too; return EOL */
+ if (c != EOF && buf == start_buf)
+ c = getc(fp);
+ break;
}
if (buf >= end_buf)