From e389bd478bb4325a36ace2c539d53af438abbfd7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 22 Jan 2026 09:58:15 +0000 Subject: [PATCH] fix: keep backslashes in quoted exec paths --- src/infra/exec-approvals.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infra/exec-approvals.ts b/src/infra/exec-approvals.ts index af0142ebc..5c9e4a826 100644 --- a/src/infra/exec-approvals.ts +++ b/src/infra/exec-approvals.ts @@ -519,7 +519,7 @@ function splitShellPipeline(command: string): { ok: boolean; reason?: string; se escaped = false; continue; } - if (!inSingle && ch === "\\") { + if (!inSingle && !inDouble && ch === "\\") { escaped = true; buf += ch; continue; @@ -595,7 +595,7 @@ function tokenizeShellSegment(segment: string): string[] | null { escaped = false; continue; } - if (!inSingle && ch === "\\") { + if (!inSingle && !inDouble && ch === "\\") { escaped = true; continue; }