src/ConnDis.c |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit d334665e619e9db657a2ea2764a8b852401d4a3f
Author: Kean Johnston <[EMAIL PROTECTED]>
Date:   Tue Jul 17 16:34:30 2007 -0700

    LOCALCONN fallback changes DisplayString() output, breaks KDE
    
    See <http://lists.freedesktop.org/archives/xorg/2007-July/026443.html>

diff --git a/src/ConnDis.c b/src/ConnDis.c
index 95a836d..8da5140 100644
--- a/src/ConnDis.c
+++ b/src/ConnDis.c
@@ -152,6 +152,7 @@ _X11TransConnectDisplay (
     int connect_stat;
 #ifdef LOCALCONN
     struct utsname sys;
+    Bool reset_hostname = False;       /* Reset hostname? */
 # ifdef UNIXCONN    
     Bool try_unix_socket = False;      /* Try unix if local fails */
 # endif    
@@ -245,6 +246,8 @@ _X11TransConnectDisplay (
        else
            tcphostname = copystring("localhost", 9);
 #endif
+       if (!phostname)
+           reset_hostname = True;
        Xfree (phostname);
        phostname = copystring ("unix", 4);
     }
@@ -429,6 +432,12 @@ _X11TransConnectDisplay (
      *
      *     [host] : [:] dpy . scr \0
      */
+#ifdef LOCALCONN
+    if (reset_hostname) {
+       Xfree (phostname);
+       phostname = NULL;
+    }
+#endif
     len = ((phostname ? strlen(phostname) : 0) + 1 + (dnet ? 1 : 0) +
           strlen(pdpynum) + 1 + (pscrnum ? strlen(pscrnum) : 1) + 1);
     *fullnamep = (char *) Xmalloc (len);


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to