Skip to content

Commit e4ba00d

Browse files
committed
docs(hooks): state both directions of subst_end's paren boundary
Claude-Session: https://claude.ai/code/session_01M82feuetLzrCiBz41BJb7L Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0963684 commit e4ba00d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎.claude/hooks/guard-main-checkout-bash.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ fi
133133
# quotes, escapes and nested `(…)` / `$(…)` / backticks; when the input ends first, to the
134134
# last index — the rest is one inert run (bash refuses such a command anyway). The body is
135135
# kept verbatim as part of the word, so a target holding it still fails open on its `$`.
136-
# Boundary: a `(` or `)` bash would not count (a `case` pattern, a comment) moves the end, and
137-
# the text after it is then read exactly as before this function existed.
136+
# Boundary: a `(` or `)` bash would not count (a `case` pattern, a comment) moves the end —
137+
# too early, and the rest is read as it was before this function existed; too late, and the
138+
# text swallowed with the body is inert, i.e. fails open.
138139
SUBST_END=0
139140
subst_end() {
140141
local s="$1" i="$2" n=${#1} st ch top

0 commit comments

Comments
 (0)