From 8c94e126c388cd9f4a48e32bc248f95bb978a360 Mon Sep 17 00:00:00 2001 From: objz Date: Tue, 25 Aug 2026 15:30:20 +0200 Subject: [PATCH] fix(net): match natives exclude prefixes on windows PathBuf renders zip entry paths with the host separator, so prefix checks against 'META-INF/' never matched and excluded entries were extracted anyway; normalize separators before matching. --- src/net/mojang.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/net/mojang.rs b/src/net/mojang.rs index db29432..9268ae0 100644 --- a/src/net/mojang.rs +++ b/src/net/mojang.rs @@ -419,7 +419,9 @@ fn extract_natives(jar: &Path, dest: &Path, exclude: &[String]) -> Result<(), Ne ); continue; }; - let name = rel.to_string_lossy(); + // zip entry names use '/', but PathBuf renders them with the host + // separator ('\'), so normalize before matching exclude prefixes. + let name = rel.to_string_lossy().replace('\\', "/"); if exclude.iter().any(|prefix| name.starts_with(prefix)) { continue; }