sharplispers / clx

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp
Other
114 stars 46 forks source link

Parsing $DISPLAY strings for decnet differs from xcb results #90

Closed PuercoPop closed 6 years ago

PuercoPop commented 6 years ago

While implementing parse-display and checking against XCB's test I found that in the case of decnet addresses CLX's xlib::get-default-display differs from XCB. In that it doesn't consider the colon as part of the host.

In CL

XCB/TESTS> (xlib::get-default-display "myws::0")
;; => ("myws" 0 0 :DECNET)

While in XCB host is myws: as you can see from the test c snippet below as well as from the test suite

Given that I know next to nothing about decnet I'm not 100% sure it is a bug in CLX, I'm inclined to believe their test suite.

// Compile it with:
// gcc scratch.c -o scratch -std=c99 -I/usr/include -I/usr/include/xcb/ -L/usr/lib/x86_64-linux-gnu -lc -lxcb
#include <stdlib.h>
#include <stdio.h>
#include <xcb.h>
#include <string.h>

int
main(int argc, char *argv[])
{
  int err;
  char *host = NULL;
  int display, screen;

  err = xcb_parse_display("myws::0", &host, &display, &screen);
  if (err == 0)
    perror("Failed to parse display");

  printf("Host: %s\n", host);

  return EXIT_SUCCESS;
}
dkochmanski commented 6 years ago

I would follow what xcb does here – patches are welcome.

PuercoPop commented 6 years ago

@dkochmanski submitted