summaryrefslogtreecommitdiff
path: root/src/bin/psql/help.c
diff options
context:
space:
mode:
authorFujii Masao2021-03-04 09:23:22 +0000
committerFujii Masao2021-03-04 09:23:22 +0000
commit4a4241e15b246663fc44b5e5355bc6d19c6d2aa6 (patch)
tree75e9a8a81f0406b7cfac83058cbe1b967ad60617 /src/bin/psql/help.c
parent85d94c575302644e7ddb4392c3bda572f981ec34 (diff)
Remove redundant getenv() for PGUSER, in psql help.
Previously psql obtained the value of PGUSER twice to display a default user in its help message. Author: Kota Miyake Reviewed-by: Nitin Jadhav, Fujii Masao Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/bin/psql/help.c')
-rw-r--r--src/bin/psql/help.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index e44120bf769..daa5081eac1 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -134,10 +134,7 @@ usage(unsigned short int pager)
fprintf(output, _(" -p, --port=PORT database server port (default: \"%s\")\n"),
env ? env : DEF_PGPORT_STR);
/* Display default user */
- env = getenv("PGUSER");
- if (!env)
- env = user;
- fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), env);
+ fprintf(output, _(" -U, --username=USERNAME database user name (default: \"%s\")\n"), user);
fprintf(output, _(" -w, --no-password never prompt for password\n"));
fprintf(output, _(" -W, --password force password prompt (should happen automatically)\n"));