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

Commit4a4241e

Browse files
committed
Remove redundant getenv() for PGUSER, in psql help.
Previously psql obtained the value of PGUSER twice to displaya default user in its help message.Author: Kota MiyakeReviewed-by: Nitin Jadhav, Fujii MasaoDiscussion:https://postgr.es/m/2a3c612babdd6ed63a9d877bb575d793@oss.nttdata.com
1 parent85d94c5 commit4a4241e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎src/bin/psql/help.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ usage(unsigned short int pager)
134134
fprintf(output,_(" -p, --port=PORT database server port (default: \"%s\")\n"),
135135
env ?env :DEF_PGPORT_STR);
136136
/* Display default user */
137-
env=getenv("PGUSER");
138-
if (!env)
139-
env=user;
140-
fprintf(output,_(" -U, --username=USERNAME database user name (default: \"%s\")\n"),env);
137+
fprintf(output,_(" -U, --username=USERNAME database user name (default: \"%s\")\n"),user);
141138
fprintf(output,_(" -w, --no-password never prompt for password\n"));
142139
fprintf(output,_(" -W, --password force password prompt (should happen automatically)\n"));
143140

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp