Commit 65da5a2
committed
Restrict filter-path parsing to filter command context
ParsePrimary previously treated any identifier starting with '.' as a FilterPathExpression unconditionally. That broke command arguments like 'jq .msg', where '.msg' is a literal jq program string passed to the external command -- the shell evaluated it against the piped input first. Gate filter-path/filter-call/zero-arg-builtin handling behind an inFilterMode flag set by ParseFilterExpression. The filter command (and Expression.Parse used by tests) enable filter mode; ordinary command arguments keep their previous shell-word semantics.1 parent 6e000fc commit 65da5a2
1 file changed
Lines changed: 14 additions & 4 deletions
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
192 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
| |||
668 | 678 | | |
669 | 679 | | |
670 | 680 | | |
671 | | - | |
| 681 | + | |
672 | 682 | | |
673 | 683 | | |
674 | 684 | | |
| |||
699 | 709 | | |
700 | 710 | | |
701 | 711 | | |
702 | | - | |
| 712 | + | |
703 | 713 | | |
704 | 714 | | |
705 | 715 | | |
706 | 716 | | |
707 | | - | |
| 717 | + | |
708 | 718 | | |
709 | 719 | | |
710 | 720 | | |
| |||
0 commit comments