(Fdelete_window): Handle deleting a parent of the selected window.
[bpt/emacs.git] / src / xrdb.c
index f241a07..6a769e3 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -54,11 +54,22 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #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)
@@ -198,12 +209,12 @@ magic_searchpath_decoder (incantation_string, file, return_path)
              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;
@@ -286,7 +297,7 @@ get_user_db (display)
   XrmDatabase db;
   char *xdefs;
 
-#ifdef HAVE_X11R4
+#ifdef PBaseSize               /* Cheap way to test for X11R4 or later.  */
   xdefs = XResourceManagerString (display);
 #else
   xdefs = display->xdefaults;
@@ -303,6 +314,15 @@ get_user_db (display)
       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;
 }