git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fallback on getpwuid if envar HOME is unset
@ 2012-08-21  1:28 Conley Owens
  2012-08-21  2:30 ` Jeff King
  2012-08-21  3:54 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Conley Owens @ 2012-08-21  1:28 UTC (permalink / raw)
  To: git; +Cc: gitster

>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>
---
 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;
+       }
+
+       if (!home) {
                if (global)
                        *global = NULL;
        } else {
-- 
1.7.11-rc3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-21 19:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).