From 4fc3902a090c8ed2aff11d6e8a2c0df600d69966 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 3 Mar 2019 11:22:22 -0800 Subject: Only check for XFree86 if vendor string doesn't match X.Org Signed-off-by: Alan Coopersmith --- xdpyinfo.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'xdpyinfo.c') diff --git a/xdpyinfo.c b/xdpyinfo.c index 152e32c..b9ddeb1 100644 --- a/xdpyinfo.c +++ b/xdpyinfo.c @@ -239,7 +239,18 @@ print_display_info(Display *dpy) printf ("vendor string: %s\n", ServerVendor (dpy)); printf ("vendor release number: %d\n", VendorRelease (dpy)); - if (strstr(ServerVendor (dpy), "XFree86")) { + if (strstr(ServerVendor (dpy), "X.Org")) { + int vendrel = VendorRelease(dpy); + + printf("X.Org version: "); + printf("%d.%d.%d", vendrel / 10000000, + (vendrel / 100000) % 100, + (vendrel / 1000) % 100); + if (vendrel % 1000) + printf(".%d", vendrel % 1000); + printf("\n"); + } + else if (strstr(ServerVendor (dpy), "XFree86")) { int vendrel = VendorRelease(dpy); printf("XFree86 version: "); @@ -280,18 +291,6 @@ print_display_info(Display *dpy) printf("\n"); } - if (strstr(ServerVendor (dpy), "X.Org")) { - int vendrel = VendorRelease(dpy); - - printf("X.Org version: "); - printf("%d.%d.%d", vendrel / 10000000, - (vendrel / 100000) % 100, - (vendrel / 1000) % 100); - if (vendrel % 1000) - printf(".%d", vendrel % 1000); - printf("\n"); - } - if (strstr(ServerVendor (dpy), "DMX")) { int vendrel = VendorRelease(dpy); int major, minor, year, month, day; -- cgit v1.2.3