changeset 5917:91caeed50c64

(gethomedir): Look at LOGNAME before USER.
author Karl Heuer <kwzh@gnu.org>
date Sat, 12 Feb 1994 00:12:15 +0000
parents 4e827db2523a
children 81dca63c4ff9
files src/xrdb.c
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xrdb.c	Fri Feb 11 23:35:47 1994 +0000
+++ b/src/xrdb.c	Sat Feb 12 00:12:15 1994 +0000
@@ -288,20 +288,17 @@
 static char *
 gethomedir ()
 {
-  int uid;
   struct passwd *pw;
   char *ptr;
   char *copy;
 
   if ((ptr = getenv ("HOME")) == NULL)
     {
-      if ((ptr = getenv ("USER")) != NULL)
+      if ((ptr = getenv ("LOGNAME")) != NULL
+	  || (ptr = getenv ("USER")) != NULL)
 	pw = getpwnam (ptr);
       else
-	{
-	  uid = getuid ();
-	  pw = getpwuid (uid);
-	}
+	pw = getpwuid (getuid ());
 
       if (pw)
 	ptr = pw->pw_dir;