Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
InfyniteHeap committed Jun 20, 2024
1 parent 3f96f4f commit 199d2f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cli/self_update/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,11 @@ fn _remove_from_path(old_path: String, path_str: String) -> Option<String> {
// for that to find the string, because if it's the last string in the path,
// there may not be.
let mut len = path_str.len();
if old_path.chars().collect::<Vec<char>>()[idx + path_str.len() - 1] == ';' {
if old_path.as_bytes().get(idx + path_str.len()) == Some(&b';') {
len += 1;
}

let mut new_path = old_path[..idx].to_string();
let mut new_path = old_path[..idx].to_owned();
new_path += &old_path[idx + len..];
// Don't leave a trailing ; though, we don't want an empty string in the
// path.
Expand Down

0 comments on commit 199d2f4

Please sign in to comment.