postgresql/src/backend
Tom Lane 1e5a5d03da Simplify some long-obsolete code in hba.c's next_token().
next_token() oddly set its buffer space consumption limit to one before
the last char position in the buffer, not the last as you'd expect.
The reason is there was once an ugly kluge to mark keywords by appending
a newline to them, potentially requiring one more byte.  Commit e5e2fc842
removed that kluge, but failed to notice that the length limit could be
increased.

Also, remove some vestigial handling of newline characters in the buffer.
That was left over from when this function read the file directly using
getc().  Commit 7f49a67f9 changed it to read from a buffer, from which
tokenize_file had already removed the only possible occurrence of newline,
but did not simplify this function in consequence.

Also, ensure that we don't return with *lineptr set to someplace past the
terminating '\0'; that would be catastrophic if a caller were to ask for
another token from the same line.  This is just latent since no callers
actually do call again after a "false" return; but considering that it was
actually costing us extra code to do it wrong, we might as well make it
bulletproof.

Noted while reviewing pg_hba_file_rules patch.
2017-01-30 18:42:41 -05:00
..
access Be more aggressive in avoiding tuple conversion. 2017-01-24 21:53:38 -05:00
bootstrap
catalog Invent pg_hba_file_rules view to show the content of pg_hba.conf. 2017-01-30 18:00:26 -05:00
commands Handle ALTER EXTENSION ADD/DROP with pg_init_privs 2017-01-29 23:05:07 -05:00
executor Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
foreign
lib
libpq Simplify some long-obsolete code in hba.c's next_token(). 2017-01-30 18:42:41 -05:00
main
nodes Logical replication 2017-01-20 09:04:49 -05:00
optimizer Refactor bitmap heap scan estimation of heap pages fetched. 2017-01-27 16:28:47 -05:00
parser Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
po
port
postmaster Fix typo: pg_statistics -> pg_statistic 2017-01-25 14:38:33 -05:00
regex
replication Reset hot standby xmin on master after restart 2017-01-26 18:14:02 +00:00
rewrite Use castNode() in a bunch of statement-list-related code. 2017-01-26 22:09:34 -05:00
snowball
storage Check interrupts during hot standby waits 2017-01-26 18:59:58 +00:00
tcop Improve comments about ProcessUtility's queryString parameter. 2017-01-27 10:02:04 -05:00
tsearch Move some things from builtins.h to new header files 2017-01-20 20:29:53 -05:00
utils Remove leftover reference to "indirect blocks" in comment. 2017-01-30 10:52:50 +02:00
.gitignore
common.mk
Makefile Fix parallel make issue with new fmgrprotos.h 2017-01-23 15:36:27 -05:00
nls.mk