diff options
author | Nicolas Williams <nico@cryptonector.com> | 2014-02-05 23:14:05 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2014-02-05 23:14:05 -0600 |
commit | 1fa55a3fae3dc6b8a2018ce64786b5b5570fde70 (patch) | |
tree | 482c79eae9e84fac1891c981af91f6e0f7275ce2 /builtin.c | |
parent | a45c937f80dd93a298d7baf0947385db9f3032dc (diff) |
Fix cut-n-paste in `leaf_paths`; doc and test 'em
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -679,7 +679,7 @@ static const char* const jq_builtins[] = { "def index(i): .[i][0];", "def rindex(i): .[i][-1:][0];", "def paths: path(recurse(if (type|. == \"array\" or . == \"object\") then .[] else empty end))|select(length > 0);", - "def leaf_paths: . as $dot|paths|select(. as $p|$dot|getpath($p)|type|. == \"array\" or . == \"object\");", + "def leaf_paths: . as $dot|paths|select(. as $p|$dot|getpath($p)|type|. != \"array\" and . != \"object\");", }; |