/* 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
#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
#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
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
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;
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);