Skip to content

Commit 3c7e002

Browse files
authored
normalize path -> case-insensitive comparison on Windows
1 parent bb67bf8 commit 3c7e002

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builder/frameworks/arduino.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@ def validate_deletion_path(path: Union[str, Path],
469469

470470
for critical in filter(None, critical_paths):
471471
try:
472-
if path == critical or critical in path.parents:
472+
normalized_path = path.resolve()
473+
normalized_critical = critical.resolve()
474+
if normalized_path == normalized_critical or normalized_critical in normalized_path.parents:
473475
logging.error(f"Critical system path detected: {path}")
474476
return False
475477
except (OSError, ValueError):

0 commit comments

Comments
 (0)