This commit is contained in:
konstin 2023-10-23 13:54:31 +02:00
parent 7f8f0d0416
commit 815c2117c8

View file

@ -672,8 +672,7 @@ fn install_script(
// > instead of a console script.
let placeholder_python = b"#!python";
// scripts might be binaries, so we read an exact number of bytes instead of the first line as string
let mut start = Vec::new();
start.resize(placeholder_python.len(), 0);
let mut start = vec![0; placeholder_python.len()];
script.read_exact(&mut start)?;
let size_and_encoded_hash = if start == placeholder_python {
let start = get_shebang(location).as_bytes().to_vec();