Content-Length: 281791 | pFad | http://github.com/postgrespro/postgres/commit/4376fdbae11de9333012a31ba8d3a4f4b5d7a692

27 C comment: clarify why psql's help/exit/quit must alone · postgrespro/postgres@4376fdb · GitHub
Skip to content

Commit 4376fdb

Browse files
committed
C comment: clarify why psql's help/exit/quit must alone
Document why no indentation and why no non-whitespace postfix is supported. Backpatch-through: master
1 parent 4cab43e commit 4376fdb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/psql/mainloop.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,13 @@ MainLoop(FILE *source)
237237
bool found_exit_or_quit = false;
238238
bool found_q = false;
239239

240-
/* Search for the words we recognize; must be first word */
240+
/*
241+
* The assistance words, help/exit/quit, must have no
242+
* whitespace before them, and only whitespace after, with an
243+
* optional semicolon. This prevents indented use of these
244+
* words, perhaps as identifiers, from invoking the assistance
245+
* behavior.
246+
*/
241247
if (pg_strncasecmp(first_word, "help", 4) == 0)
242248
{
243249
rest_of_line = first_word + 4;
@@ -249,7 +255,6 @@ MainLoop(FILE *source)
249255
rest_of_line = first_word + 4;
250256
found_exit_or_quit = true;
251257
}
252-
253258
else if (strncmp(first_word, "\\q", 2) == 0)
254259
{
255260
rest_of_line = first_word + 2;

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/commit/4376fdbae11de9333012a31ba8d3a4f4b5d7a692

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy