git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6867f96) | patch
Prefer $HOME when looking up the current user's home directory.
2022年1月10日 00:19:02 +0000 (19:19 -0500)
2022年1月10日 00:19:02 +0000 (19:19 -0500)
commit 376ce3e404b75d267089c4bc6dc7c18d0b38728b
Prefer $HOME when looking up the current user's home directory.

When we need to identify the home directory on non-Windows, first
consult getenv("HOME"). If that's empty or unset, fall back
on our previous method of checking the <pwd.h> database.

Preferring $HOME allows the user to intentionally point at some
other directory, and it seems to be in line with the behavior of
most other utilities. However, we shouldn't rely on it completely,
as $HOME is likely to be unset when running as a daemon.

Anders Kaseorg

Discussion: https://postgr.es/m/1634252654444.90107@mit.edu
src/bin/psql/command.c diff | blob | blame | history
src/interfaces/libpq/fe-connect.c diff | blob | blame | history
src/port/path.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /