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.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#28708: closed (27.0.50; [PATCH] Fix search for
 ~/.Xdefaults-HOSTNAME)
Date: Wed, 04 Oct 2017 22:27:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 4 Oct 2017 15:26:31 -0700
with message-id <a72ec583-e920-d150-a8ea-77d753e3997c <at> cs.ucla.edu>
and subject line Re: bug#28708: 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
has caused the debbugs.gnu.org bug report #28708,
regarding 27.0.50; [PATCH] Fix search for ~/.Xdefaults-HOSTNAME
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
28708: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=28708
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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);


[Message part 3 (message/rfc822, inline)]
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.


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

Previous Next


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