rust-pathauditor: actually split Windows shortname aliases at `~`
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 04 Mar 2020 15:10:03 +0100
changeset 44533 e63b4a1f2271
parent 44532 c989737158aa
child 44534 8a237131ff0f
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
rust/hg-core/src/utils/path_auditor.rs
--- 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();