GNU bug report logs - #28708
27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME

Previous Next

Package: emacs;

Reported by: Johan Bockgård <bojohan <at> gnu.org>

Date: Wed, 4 Oct 2017 21:45:02 UTC

Severity: normal

Tags: patch

Merged with 28712

Found in versions 25.3, 27.0.50

Fixed in version 26.1

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28708 in the body.
You can then email your comments to 28708 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org:
bug#28708; Package emacs. (Wed, 04 Oct 2017 21:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Johan Bockgård <bojohan <at> gnu.org>:
New bug report received and forwarded. Copy sent to eggert <at> cs.ucla.edu, bug-gnu-emacs <at> gnu.org. (Wed, 04 Oct 2017 21:45:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Johan Bockgård <bojohan <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
Date: Wed, 04 Oct 2017 23:44:31 +0200
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 <at> 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);




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 04 Oct 2017 22:27:02 GMT) Full text and rfc822 format available.

Notification sent to Johan Bockgård <bojohan <at> gnu.org>:
bug acknowledged by developer. (Wed, 04 Oct 2017 22:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 28708-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Johan Bockgård <bojohan <at> gnu.org>,
 28708-done <at> debbugs.gnu.org
Subject: Re: bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
Date: Wed, 4 Oct 2017 15:26:31 -0700
Thanks for catching that bug. I installed the patch in your name into 
the emacs-26 branch.




Merged 28708 28712. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Thu, 05 Oct 2017 14:29:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 03 Nov 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 283 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.