Commit 47770a9b authored by Adam Jackson's avatar Adam Jackson 🎧 Committed by Alan Coopersmith
Browse files

xdpyinfo: Fix printing the X.Org release version for xserver >= 21

Without this you'd get 1.21.1.4 instead of 21.1.4.
parent 0cde4d53
Pipeline #552389 passed with stages
in 1 minute and 15 seconds
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment