changeset 44533:e63b4a1f2271

rust-pathauditor: actually split Windows shortname aliases at `~` Right now, splitting with a max of 1 parts is useless. Differential Revision: https://phab.mercurial-scm.org/D8211
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 04 Mar 2020 15:10:03 +0100
parents c989737158aa
children 8a237131ff0f
files rust/hg-core/src/utils/path_auditor.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/utils/path_auditor.rs	Thu Mar 05 10:24:45 2020 +0100
+++ b/rust/hg-core/src/utils/path_auditor.rs	Wed Mar 04 15:10:03 2020 +0100
@@ -67,7 +67,7 @@
         // Windows shortname aliases
         for part in parts.iter() {
             if part.contains(&b'~') {
-                let mut split = part.splitn(1, |b| *b == b'~');
+                let mut split = part.splitn(2, |b| *b == b'~');
                 let first =
                     split.next().unwrap().to_owned().to_ascii_uppercase();
                 let last = split.next().unwrap();