fix(exec): guard POSIX double-slash absolute paths

This commit is contained in:
Xubin Ren
2026-08-13 01:53:38 +09:00
parent 6fc0807fbf
commit 001a7492c2
2 changed files with 22 additions and 2 deletions
+4 -2
View File
@@ -1012,8 +1012,10 @@ class ExecTool(Tool):
)
posix_paths = [
p.rstrip(");},")
for p in re.findall(r"(?:^|[\s|><='\"({,:])(/[^\"'>;|<()\s]+)", command)
if not p.startswith("//")
for p in re.findall(
r"(?:^|[\s|><='\"({,]|:(?!//))(/[^\"'>;|<()\s]+)",
command,
)
]
home_paths = [
p.rstrip(");},")