Skip to content

Commit

Permalink
Sanitize package path
Browse files Browse the repository at this point in the history
The label to a crate with a '+' character in its version is correctly
sanitized in references to it in BUILD files, but its path on disk is
not, which means these references are broken.
  • Loading branch information
HackAttack committed Sep 8, 2023
1 parent 1f9b63a commit 75572b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crate_universe/src/rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,11 @@ impl Renderer {

fn label_to_path(label: &Label) -> PathBuf {
match &label.package {
Some(package) => PathBuf::from(format!("{}/{}", package, label.target)),
Some(package) => PathBuf::from(format!(
"{}/{}",
sanitize_repository_name(package),
label.target
)),
None => PathBuf::from(&label.target),
}
}
Expand Down

0 comments on commit 75572b4

Please sign in to comment.