From 379a2724984d903b7be8981a85b6cc82cab6ea90 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 12 Sep 2007 13:36:20 +0200 Subject: [PATCH] string.c: Use $HOME to get the home directory. This is actually simpler than using getpwuid(), and it shuts up a valgrind warning as well. --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string.c b/string.c index 60050ad7..0d7e05e6 100644 --- a/string.c +++ b/string.c @@ -300,8 +300,8 @@ __must_check __malloc char *para_logname(void) */ __must_check __malloc char *para_homedir(void) { - struct passwd *pw = getpwuid(getuid()); - return para_strdup(pw? pw->pw_dir : "/tmp"); + char *h = getenv("HOME"); + return para_strdup(h? h : "/tmp"); } /** -- 2.39.5