From 096b11e234ccfca6e9546769588466b7b178e594 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 3 Jan 2023 13:48:04 -0500 Subject: [PATCH] Fix Mac minor version in getOperatingSystemInfo() for Mac >=13. --- src/system.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/system.cpp b/src/system.cpp index 838676c3..a4b3599c 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -824,7 +824,8 @@ std::string getOperatingSystemInfo() { char osversion[32]; int osversion_name[2] = {CTL_KERN, KERN_OSRELEASE}; size_t osversion_len = sizeof(osversion) - 1; - if (sysctl(osversion_name, 2, osversion, &osversion_len, NULL, 0) != 0) return "Mac"; + if (sysctl(osversion_name, 2, osversion, &osversion_len, NULL, 0) != 0) + return "Mac"; int major = 0; int minor = 0; @@ -833,6 +834,9 @@ std::string getOperatingSystemInfo() { // Try to match version numbers to retail versions if (major >= 20) { + if (major >= 22) { + minor -= 1; + } major -= 9; return string::f("Mac %d.%d", major, minor); }