summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ Phani Mahesh <github@phanimahesh.me>2017-02-07 14:14:29 +0530
committerNico Williams <nico@cryptonector.com>2017-02-07 21:30:55 -0600
commitdc679081fa770c260ca9a569a8a4fdbb10bcdc20 (patch)
treedc2b0b90e4ab58057d3f8849afd410ce453abea0
parent597c1f6667746058e88a9f6fb0415f80fe114b18 (diff)
fix truncate_stream to match docs
-rw-r--r--src/builtin.jq2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/builtin.jq b/src/builtin.jq
index f7c6e9b7..f01280a7 100644
--- a/src/builtin.jq
+++ b/src/builtin.jq
@@ -210,7 +210,7 @@ def ascii_upcase:
# Streaming utilities
def truncate_stream(stream):
- . as $n | null | stream | . as $input | if (.[0]|length) > $n then setpath([0];$input[0][1:]) else empty end;
+ . as $n | null | stream | . as $input | if (.[0]|length) > $n then setpath([0];$input[0][$n:]) else empty end;
def fromstream(i):
foreach i as $item (
[null,false,null,false];