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.
This commit is contained in:
1 parent
937e9dac1f
commit
8c94e126c3
1 file changed
+3
-1
+3
-1
@@ -419,7 +419,9 @@ fn extract_natives(jar: &Path, dest: &Path, exclude: &[String]) -> Result<(), Ne
|
|||||||
);
|
);
|
||||||
continue;
|
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)) {
|
if exclude.iter().any(|prefix| name.starts_with(prefix)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user