Commit eb12af4
committed
fix: add { to glob-char guards and use single-pass template replacer
Three correctness fixes found during round-3 code review:
1. validatePathEntry (allowGlob=false) was missing { from the rejected
glob metacharacter set. The comment already documented { as forbidden
for outputs; the code now enforces it consistently with *, ?, and [.
2. isGlobPattern in locate.go used "*?[" — missing { for brace expansion
({a,b}) which doublestar supports. Misclassifying a brace-glob input
as a literal path caused LSP go-to-definition to navigate to a
nonexistent file. Now matches hasGlobMeta in linkgraph/directives.go.
3. generateBody used two sequential strings.ReplaceAll calls. If an
output path contained {alt}, the first pass would introduce {alt}
into the body and the second pass would expand it again. Replaced
with strings.NewReplacer (single-pass, immune to this).
https://claude.ai/code/session_0166NMrRbK1uDGk847FENqZ91 parent 0a514c1 commit eb12af4
4 files changed
Lines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
| 299 | + | |
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
| |||
370 | 369 | | |
371 | 370 | | |
372 | 371 | | |
373 | | - | |
| 372 | + | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
| |||
0 commit comments