From: Junio C Hamano <gitster@pobox.com>
To: Conley Owens <cco3@android.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fallback on getpwuid if envar HOME is unset
Date: Mon, 20 Aug 2012 20:54:09 -0700 [thread overview]
Message-ID: <7vipccgase.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAFFUb6WiXJ0n4NkhOQ=+mcfs+uaAo2_G6TOs7L=AuPwPVfxyMg@mail.gmail.com> (Conley Owens's message of "Mon, 20 Aug 2012 18:28:57 -0700")
Conley Owens <cco3@android.com> writes:
> From f64ba3c908b33a2ea5a5ad1f0e5800af76b82ce9 Mon Sep 17 00:00:00 2001
> From: Conley Owens <cco3@android.com>
> Date: Mon, 20 Aug 2012 18:23:40 -0700
> Subject: [PATCH] Fallback on getpwuid if envar HOME is unset
>
> Signed-off-by: Conley Owens <cco3@android.com>
> ---
We can see you are doing what you claim on the title (modulo "envar"
typo) to be doing, but it is unclear why this patch wants to exist
in the first place.
If the user for whatever reason "unset HOME", why is it a good idea
to read from a place that is found by getpwuid()? What problem does
it want to fix? Why does a user want this updated behaviour?
> path.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/path.c b/path.c
> index 66acd24..60affab 100644
> --- a/path.c
> +++ b/path.c
> @@ -144,6 +144,11 @@ void home_config_paths(char **global, char **xdg,
> char *file)
> char *to_free = NULL;
>
> if (!home) {
> + struct passwd *pw = xgetpwuid_self();
> + home = pw->pw_dir;
One level of indent is a HT, not two spaces.
> + }
> +
> + if (!home) {
> if (global)
> *global = NULL;
> } else {
prev parent reply other threads:[~2012-08-21 3:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 1:28 [PATCH] Fallback on getpwuid if envar HOME is unset Conley Owens
2012-08-21 2:30 ` Jeff King
2012-08-21 17:18 ` Conley Owens
2012-08-21 18:22 ` Junio C Hamano
2012-08-21 18:33 ` Conley Owens
2012-08-21 19:22 ` Junio C Hamano
2012-08-21 19:40 ` Jeff King
2012-08-21 18:41 ` Andreas Schwab
2012-08-21 3:54 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vipccgase.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=cco3@android.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.