aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/xcb_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxcb/src/xcb_util.c')
-rw-r--r--libxcb/src/xcb_util.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c
index e1e48ce0d..b999ea528 100644
--- a/libxcb/src/xcb_util.c
+++ b/libxcb/src/xcb_util.c
@@ -178,22 +178,20 @@ static int _xcb_open(const char *host, char *protocol, const int display)
int actual_filelen;
#ifdef HAVE_LAUNCHD
- if(strncmp(host, "/tmp/launch", 11) == 0) {
- base = host;
- host = "";
- protocol = NULL;
- }
+ if(strncmp(host, "/tmp/launch", 11) == 0) {
+ base = host;
+ host = "";
+ protocol = NULL;
+ }
#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