summaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorWilliam Langford <wlangfor@gmail.com>2014-11-12 20:46:34 -0500
committerWilliam Langford <wlangfor@gmail.com>2014-11-12 20:46:34 -0500
commit30e00820a7cd6a198bc24a0499ee5c3ceb38ae75 (patch)
tree75014a4c95ea89f05a45e55d047162f03a932d07 /builtin.c
parent89791a000ba8fd614d8a8fa59a5ba76f21ea4d1d (diff)
Fix #600. Add regression test
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin.c b/builtin.c
index ddd207b3..0629ca99 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1057,9 +1057,7 @@ static const char* const jq_builtins[] = {
// # create the \"capture\" object:
" | reduce ( $r | .captures | .[] | select(.name != null) | { (.name) : .string } ) as $pair"
" ({}; . + $pair)"
- " | if . == {} then $in | .[0:$r.offset]+s+.[$r.offset+$r.length:]"
- " else (. | s)"
- " end"
+ " | $in[0:$r.offset] + s + $in[$r.offset+$r.length:]"
" end ;",
//
// repeated substitution of re (which may contain named captures)