- if (!strncmp(display, "localhost:", 10))
- command = dupprintf("xauth list %s 2>/dev/null", display+9);
+ if (!strncmp(display, "localhost:", 10)
+ || !strncmp(display, "unix:", 5))
+ command = dupprintf("xauth list %s 2>/dev/null",
+ strchr(display, ':'));