$OpenBSD: patch-src_LYUtils_c,v 1.1 2016/03/12 14:29:13 tb Exp $

Use getenv("HOME") to determine the home directory instead of using getpwuid in
order to avoid a "getpw" promise.  This is the only location not covered by the
'-DNOUSERS' option in the Makefile.  If HOME is unset, the fallback is /tmp, so
no breakage is to be expected from this.

--- src/LYUtils.c.orig	Sun Mar 22 16:38:23 2015
+++ src/LYUtils.c	Sun Jan 31 07:49:03 2016
@@ -5253,10 +5253,11 @@ const char *Home_Dir(void)
 	    /*
 	     * One could use getlogin() and getpwnam() here instead.
 	     */
-	    struct passwd *pw = getpwuid(geteuid());
+	    char *home;
 
-	    if (pw && pw->pw_dir) {
-		StrAllocCopy(HomeDir, pw->pw_dir);
+	    home = getenv("HOME");
+	    if (home && *home) {
+		StrAllocCopy(HomeDir, home);
 	    } else
 #endif
 	    {
