+ display = x11_display(display);
+ /*
+ * Normally we should run `xauth list DISPLAYNAME'. However,
+ * there's an oddity when the display is local: the display
+ * `localhost:0' (or `:0') should become just `:0'.
+ */
+ if (!strncmp(display, "localhost:", 10)
+ || !strncmp(display, "unix:", 5))
+ command = dupprintf("xauth list %s 2>/dev/null",
+ strchr(display, ':'));
+ else
+ command = dupprintf("xauth list %s 2>/dev/null", display);
+ sfree(display);