Skip to content

Commit 7a9c74c

Browse files
committed
NativeVariant: readFeatureFlags() workaround for macOS
1 parent 2799244 commit 7a9c74c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

snaploader/src/main/java/electrostatic4j/snaploader/platform/util/NativeVariant.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,13 @@ private static Collection<String> readFeatureFlags() {
287287
// Convert the list to a collection of feature names:
288288
Collection<String> result = new TreeSet<>();
289289
for (String oshiString : oshiList) {
290+
/*
291+
* On macOS, strings ending with ": 0" indicate
292+
* disabled features, so ignore all such lines.
293+
*/
294+
if (oshiString.endsWith(": 0")) {
295+
continue;
296+
}
290297
String lcString = oshiString.toLowerCase(Locale.ROOT);
291298
Matcher matcher = pattern.matcher(lcString);
292299
while (matcher.find()) {

0 commit comments

Comments
 (0)