summaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2014-10-03 17:35:01 -0500
committerNicolas Williams <nico@cryptonector.com>2014-10-03 17:47:13 -0500
commit0b29b44cab83ed7730c8b9d20c026367cc710a7e (patch)
tree9aae1e0bf1f0b66950411f5a108178468d5b3ee1 /builtin.c
parenta0a350f46808229bb25fe16ca8e82e4c2fe76d7c (diff)
from-entries should work with EC2 (fix #592)
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index 0c0faa31..4dc34a59 100644
--- a/builtin.c
+++ b/builtin.c
@@ -970,7 +970,7 @@ static const char* const jq_builtins[] = {
"def recurse_down: recurse;",
"def to_entries: [keys_unsorted[] as $k | {key: $k, value: .[$k]}];",
- "def from_entries: map({(.key): .value}) | add | .//={};",
+ "def from_entries: map({(.key // .Key): (.value // .Value)}) | add | .//={};",
"def with_entries(f): to_entries | map(f) | from_entries;",
"def reverse: [.[length - 1 - range(0;length)]];",
"def indices($i): if type == \"array\" and ($i|type) == \"array\" then .[$i] elif type == \"array\" then .[[$i]] else .[$i] end;",