unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
@ 2017-10-04 21:44 Johan Bockgård
  2017-10-04 22:26 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Bockgård @ 2017-10-04 21:44 UTC (permalink / raw)
  To: 28708; +Cc: eggert

Emacs is supposed to look for X resources in ~/.Xdefaults-HOSTNAME, but
the code forgets the hyphen in the filename.

The bug was introduced in Emacs 25.1, by commit
1e6879dbdb0832427f5c588c89a53a8a80768a00:

2014-12-25  Paul Eggert  <eggert@cs.ucla.edu>

       Prefer stpcpy to strcat ...


**

The patch (should this go in the emacs-26 branch?):


diff --git a/src/xrdb.c b/src/xrdb.c
index 15a0147..3c1bad1 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -345,6 +345,7 @@ get_user_db (Display *display)
     db = XrmGetStringDatabase (xdefs);
   else
     {
+      /* Use ~/.Xdefaults.  */
       char *home = gethomedir ();
       ptrdiff_t homelen = strlen (home);
       char *filename = xrealloc (home, homelen + sizeof xdefaults);
@@ -375,13 +376,15 @@ get_environ_db (void)
 
   if (!p)
     {
+      /* Use ~/.Xdefaults-HOSTNAME.  */
       char *home = gethomedir ();
       ptrdiff_t homelen = strlen (home);
       Lisp_Object system_name = Fsystem_name ();
       ptrdiff_t filenamesize = (homelen + sizeof xdefaults
-				+ SBYTES (system_name));
+				+ 1 + SBYTES (system_name));
       p = filename = xrealloc (home, filenamesize);
-      lispstpcpy (stpcpy (filename + homelen, xdefaults), system_name);
+      lispstpcpy (stpcpy (stpcpy (filename + homelen, xdefaults), "-"),
+		  system_name);
     }
 
   db = XrmGetFileDatabase (p);





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
  2017-10-04 21:44 bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME Johan Bockgård
@ 2017-10-04 22:26 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2017-10-04 22:26 UTC (permalink / raw)
  To: Johan Bockgård, 28708-done

Thanks for catching that bug. I installed the patch in your name into 
the emacs-26 branch.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-04 22:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-04 21:44 bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME Johan Bockgård
2017-10-04 22:26 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).