From 1fa55a3fae3dc6b8a2018ce64786b5b5570fde70 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 5 Feb 2014 23:14:05 -0600 Subject: Fix cut-n-paste in `leaf_paths`; doc and test 'em --- builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index f5c48a6a..aac993db 100644 --- a/builtin.c +++ b/builtin.c @@ -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\");", }; -- cgit v1.2.3