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 329c0d6 commit 738c187Copy full SHA for 738c187
src/murfey/util/__init__.py
@@ -31,12 +31,9 @@ def secure_path(in_path: Path, keep_spaces: bool = False) -> Path:
31
for p, part in enumerate(in_path.parts):
32
if p == 0 and ":" in part:
33
secured_parts.append(secure_filename(part) + ":")
34
- continue # Skip subsequent conditions and move to next part
35
- if keep_spaces:
36
- if " " in part:
37
- secured_parts.append(part)
38
39
- if part.endswith("_"):
+ elif " " in part and keep_spaces:
+ secured_parts.append(part)
+ elif part.endswith("_"):
40
# Preserve all trailing underscores
41
num_underscores = len(part) - len(part.rstrip("_"))
42
secured_parts.append(secure_filename(part) + (num_underscores * "_"))
0 commit comments