- /* display specifies TCP */
- unsigned short port = X_TCP_PORT + display;
- fd = _xcb_open_tcp(host, port);
+#ifdef HAVE_LAUNCHD
+ if(strncmp(host, "/tmp/launch", 11) == 0) {
+ base = host;
+ } else {
+#endif
+
+#ifdef DNETCONN
+ /* DECnet displays have two colons, so _xcb_parse_display will have
+ left one at the end. However, an IPv6 address can end with *two*
+ colons, so only treat this as a DECnet display if host ends with
+ exactly one colon. */
+ char *colon = strchr(host, ':');
+ if(colon && *(colon+1) == '\0')
+ {
+ *colon = '\0';
+ return _xcb_open_decnet(host, protocol, display);
+ }
+ else
+#endif
+ 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);
+ }
+#ifdef HAVE_LAUNCHD
+ }
+#endif