Skip to content

Commit 38f4c5c

Browse files
committed
Ensure comparison only matches the name
1 parent d488c31 commit 38f4c5c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/manage/aliasutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _create_alias(
9999
p = cmd.global_dir / name
100100
# Raise exception if someone has tried to get us to write outside of the
101101
# intended directory
102-
if str(p.relative_to(cmd.global_dir)) != name:
102+
if str(p.relative_to(cmd.global_dir)) != PurePath(name).name:
103103
raise ValueError(f"Invalid alias name: {name}")
104104
if not p.match("*.exe"):
105105
p = p.with_name(p.name + ".exe")

0 commit comments

Comments
 (0)