Skip to content

Commit effafb6

Browse files
committed
Only keep colon for first part
1 parent 583a92b commit effafb6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/murfey/util/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ def secure_path(in_path: Path, keep_spaces: bool = False) -> Path:
7979
]
8080
else:
8181
secured_parts = [
82-
secure_filename(p) + ":" if p.endswith(":") else secure_filename(p)
83-
for p in in_path.parts
82+
(
83+
secure_filename(part) + ":"
84+
if p == 0 and ":" in part
85+
else secure_filename(part)
86+
)
87+
for p, part in enumerate(in_path.parts)
8488
]
8589
return Path("/".join(secured_parts))
8690

0 commit comments

Comments
 (0)