Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4376fdb

Browse files
committed
C comment: clarify why psql's help/exit/quit must alone
Document why no indentation and why no non-whitespace postfix issupported.Backpatch-through: master
1 parent4cab43e commit4376fdb

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
boolfound_exit_or_quit= false;
238238
boolfound_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
elseif (strncmp(first_word,"\\q",2)==0)
254259
{
255260
rest_of_line=first_word+2;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp