summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xdpyinfo.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/xdpyinfo.c b/xdpyinfo.c
index dda04c7..b201ad3 100644
--- a/xdpyinfo.c
+++ b/xdpyinfo.c
@@ -245,12 +245,19 @@ print_display_info(Display *dpy)
int vendrel = VendorRelease(dpy);
printf("X.Org version: ");
- printf("%d.%d.%d", vendrel / 10000000,
+ if (vendrel >= 12100000) {
+ vendrel -= 10000000; /* Y2.1K compliant */
+ printf("%d.%d",
(vendrel / 100000) % 100,
(vendrel / 1000) % 100);
- if (vendrel % 1000)
- printf(".%d", vendrel % 1000);
- printf("\n");
+ } else {
+ 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);