/* Deal with the X Resource Manager.
- Copyright (C) 1990, 1992 Free Software Foundation.
+ Copyright (C) 1990, 1993 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
#endif
extern char *getenv ();
+
+/* This does cause trouble on AIX. I'm going to take the comment at
+ face value. */
+#if 0
extern short getuid (); /* If this causes portability problems,
I think we should just delete it; it'll
default to `int' anyway. */
+#endif
+
+#ifdef __bsdi__
+extern struct passwd *getpwuid (uid_t);
+extern struct passwd *getpwnam (const char *);
+#else
extern struct passwd *getpwuid ();
extern struct passwd *getpwnam ();
+#endif
static char *
gethomedir (dirname)
string = (char *) alloca (string_size * sizeof (*string));
}
bcopy (s, string, len);
- string[len + 1] = '\0';
+ string[len] = '\0';
if (decode_magic (string, file, return_path))
return 1;
}
- if (p)
+ if (p && *p != 0)
s = p + 1;
else
return 0;
XrmDatabase db;
char *xdefs;
-#ifdef HAVE_X11R4
+#ifdef PBaseSize /* Cheap way to test for X11R4 or later. */
xdefs = XResourceManagerString (display);
#else
xdefs = display->xdefaults;
db = XrmGetFileDatabase (xdefault);
}
+#ifdef XlibSpecificationRelease
+#if XlibSpecificationRelease >= 5
+ /* Get the screen-specific resources too. */
+ xdefs = XScreenResourceString (DefaultScreenOfDisplay (display));
+ if (xdefs != NULL)
+ XrmMergeDatabases (XrmGetStringDatabase (xdefs), &db);
+#endif
+#endif
+
return db;
}