From 70c87b0936ab7780196cf8d8ecf380ca8fd0ba26 Mon Sep 17 00:00:00 2001 From: Timothy Rule <34501912+trulede@users.noreply.github.com> Date: Sat, 25 Apr 2026 22:02:29 +0200 Subject: [PATCH] Handle the error condition when calling WordsSeq. --- internal/execext/exec.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/execext/exec.go b/internal/execext/exec.go index 811e9442af..a418a2aa11 100644 --- a/internal/execext/exec.go +++ b/internal/execext/exec.go @@ -127,7 +127,10 @@ func ExpandFields(s string) ([]string, error) { s = escape(s) p := syntax.NewParser() var words []*syntax.Word - for w := range p.WordsSeq(strings.NewReader(s)) { + for w, err := range p.WordsSeq(strings.NewReader(s)) { + if err != nil { + return nil, err + } words = append(words, w) } cfg := &expand.Config{