]> code.delx.au - gnu-emacs/blobdiff - src/xrdb.c
(have_menus_p): Renamed from using_x_p.
[gnu-emacs] / src / xrdb.c
index 112badf3629e0bf5c18f1ffe6f1078c46ac08a22..ea2bdd13c007679af7684990e7e6f8ff3297b04d 100644 (file)
@@ -1,5 +1,5 @@
 /* Deal with the X Resource Manager.
-   Copyright (C) 1990, 1993 Free Software Foundation.
+   Copyright (C) 1990, 1993, 1994 Free Software Foundation.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -26,16 +26,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #if 1 /* I'd really appreciate it if this code could go away...  -JimB */
 /* this avoids lossage in the `dual-universe' headers on AT&T SysV X11 */
 #ifdef USG5
+#ifndef SYSV
 #define SYSV
+#endif
 #include <unistd.h>
 #endif /* USG5 */
 
 #endif /* 1 */
 
-/* This should be included before the X include files; otherwise, we get
-   warnings about redefining NULL under BSD 4.3.  */
-#include <sys/param.h>
-
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 #if 0
@@ -51,10 +49,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #endif
 #include <sys/stat.h>
 
-#ifndef MAXPATHLEN
-#define MAXPATHLEN     256
-#endif
-
 #if !defined(S_ISDIR) && defined(S_IFDIR)
 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 #endif
@@ -69,7 +63,7 @@ extern short getuid ();               /* If this causes portability problems,
                                   default to `int' anyway.  */
 #endif
 
-#if defined (__bsdi__) || defined (DECLARE_GETPWUID_WITH_UID_T)
+#ifdef DECLARE_GETPWUID_WITH_UID_T
 extern struct passwd *getpwuid (uid_t);
 extern struct passwd *getpwnam (const char *);
 #else
@@ -288,20 +282,17 @@ magic_file_p (string, string_len, class, escaped_suffix, suffix)
 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;
@@ -524,7 +515,11 @@ x_load_resources (display, xrm_string, myname, myclass)
   XrmDatabase db;
 
   x_rm_string = XrmStringToQuark (XrmStringType);
+#ifndef USE_X_TOOLKIT
+  /* pmr@osf.org says this shouldn't be done if USE_X_TOOLKIT.
+     I suspect it's because the toolkit version does this elsewhere.  */
   XrmInitialize ();
+#endif
   rdb = XrmGetStringDatabase ("");
 
   user_database = get_user_db (display);