We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1d39ba commit b75b288Copy full SHA for b75b288
src/murfey/util/__init__.py
@@ -74,9 +74,14 @@ def sanitise_nonpath(in_string: str) -> str:
74
75
def secure_path(in_path: Path, keep_spaces: bool = False) -> Path:
76
if keep_spaces:
77
- secured_parts = [
78
- secure_filename(p) if " " not in p else p for p in in_path.parts
79
- ]
+ secured_parts = []
+ for p, part in enumerate(in_path.parts):
+ if " " in part:
80
+ secured_parts.append(part)
81
+ elif ":" in part and not p:
82
+ secured_parts.append(secure_filename(part) + ":")
83
+ else:
84
+ secured_parts.append(secure_filename(part))
85
else:
86
secured_parts = [
87
(
0 commit comments