Skip to content

Commit

Permalink
Handle strange version formats in module scanning better
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Jan 27, 2024
1 parent 6469b94 commit 5cce1df
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ private static void checkRTSSModules() {
}
}

private static final Pattern RTSS_VERSION_PATTERN = Pattern.compile("^(?<x>\\d*), (?<y>\\d*), (?<z>\\d*), (?<w>\\d*)$");
// BUG: For some reason, the version string can either be in the format of "X.Y.Z.W" or "X, Y, Z, W"...
// This does not make sense, and probably points to our handling of code pages being wrong. But for the time being,
// the regex has been made to handle both formats, because looking at Win32 code any longer is going to break me.
private static final Pattern RTSS_VERSION_PATTERN = Pattern.compile("^(?<x>\\d*)(, |\\.)(?<y>\\d*)(, |\\.)(?<z>\\d*)(, |\\.)(?<w>\\d*)$");

private static boolean isRTSSCompatible(String version) {
var matcher = RTSS_VERSION_PATTERN.matcher(version);
Expand Down

0 comments on commit 5cce1df

Please sign in to comment.