X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fxcb_util.c;h=fde4f85f10a132658b1fad6f1db561871f85cdfe;hb=b64cd0df884e7901ff13def0272df74962035920;hp=818746b3cca10cc7852d6e3256ae62a268e861cb;hpb=b027922ebf1931885e00629c20e26f14f184998d;p=free-sw%2Fxcb%2Flibxcb diff --git a/src/xcb_util.c b/src/xcb_util.c index 818746b..fde4f85 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -178,15 +178,13 @@ static int _xcb_open(const char *host, char *protocol, const int display) } #endif - if(*host || protocol) + /* If protocol or host is "unix", fall through to Unix socket code below */ + if ((!protocol || (strcmp("unix",protocol) != 0)) && + (*host != '\0') && (strcmp("unix",host) != 0)) { - if (protocol - || strcmp("unix",host)) { /* follow the old unix: rule */ - - /* display specifies TCP */ - unsigned short port = X_TCP_PORT + display; - return _xcb_open_tcp(host, protocol, port); - } + /* display specifies TCP */ + unsigned short port = X_TCP_PORT + display; + return _xcb_open_tcp(host, protocol, port); } #ifndef _WIN32