jq: update to 1.6.
This commit is contained in:
parent
3aa797cb3a
commit
243ab30f9f
3 changed files with 9 additions and 60 deletions
|
@ -1,22 +0,0 @@
|
|||
https://github.com/stedolan/jq/issues/995
|
||||
|
||||
--- jv_parse.c.orig
|
||||
+++ jv_parse.c
|
||||
@@ -383,7 +383,7 @@ static pfunc stream_token(struct jv_parser* p, char ch) {
|
||||
|
||||
static void tokenadd(struct jv_parser* p, char c) {
|
||||
assert(p->tokenpos <= p->tokenlen);
|
||||
- if (p->tokenpos == p->tokenlen) {
|
||||
+ if (p->tokenpos >= (p->tokenlen - 1)) {
|
||||
p->tokenlen = p->tokenlen*2 + 256;
|
||||
p->tokenbuf = jv_mem_realloc(p->tokenbuf, p->tokenlen);
|
||||
}
|
||||
@@ -485,7 +485,7 @@ static pfunc check_literal(struct jv_parser* p) {
|
||||
TRY(value(p, v));
|
||||
} else {
|
||||
// FIXME: better parser
|
||||
- p->tokenbuf[p->tokenpos] = 0; // FIXME: invalid
|
||||
+ p->tokenbuf[p->tokenpos] = 0;
|
||||
char* end = 0;
|
||||
double d = jvp_strtod(&p->dtoa, p->tokenbuf, &end);
|
||||
if (end == 0 || *end != 0)
|
|
@ -1,35 +0,0 @@
|
|||
From 904ee3bf26f863b7b31c4085f511e54c0307e537 Mon Sep 17 00:00:00 2001
|
||||
From: W-Mark Kubacki <wmark@hurrikane.de>
|
||||
Date: Fri, 19 Aug 2016 19:50:39 +0200
|
||||
Subject: [PATCH] Skip printing what's below a MAX_PRINT_DEPTH
|
||||
|
||||
This addresses #1136, and mitigates a stack exhaustion when printing
|
||||
a very deeply nested term.
|
||||
---
|
||||
jv_print.c | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
--- jv_print.c
|
||||
+++ jv_print.c
|
||||
@@ -13,6 +13,10 @@
|
||||
#include "jv_dtoa.h"
|
||||
#include "jv_unicode.h"
|
||||
|
||||
+#ifndef MAX_PRINT_DEPTH
|
||||
+#define MAX_PRINT_DEPTH (256)
|
||||
+#endif
|
||||
+
|
||||
#define ESC "\033"
|
||||
#define COL(c) (ESC "[" c "m")
|
||||
#define COLRESET (ESC "[0m")
|
||||
@@ -150,7 +154,9 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
|
||||
}
|
||||
}
|
||||
}
|
||||
- switch (jv_get_kind(x)) {
|
||||
+ if (indent > MAX_PRINT_DEPTH) {
|
||||
+ put_str("<skipped: too deep>", F, S, flags & JV_PRINT_ISATTY);
|
||||
+ } else switch (jv_get_kind(x)) {
|
||||
default:
|
||||
case JV_KIND_INVALID:
|
||||
if (flags & JV_PRINT_INVALID) {
|
|
@ -1,8 +1,9 @@
|
|||
# Template file for 'jq'
|
||||
pkgname=jq
|
||||
version=1.5
|
||||
revision=7
|
||||
version=1.6
|
||||
revision=1
|
||||
build_style=gnu-configure
|
||||
hostmakedepends="automake libtool"
|
||||
makedepends="oniguruma-devel"
|
||||
checkdepends="valgrind"
|
||||
short_desc="Command-line JSON processor"
|
||||
|
@ -10,7 +11,12 @@ maintainer="Leah Neukirchen <leah@vuxu.org>"
|
|||
license="MIT"
|
||||
homepage="http://stedolan.github.io/jq/"
|
||||
distfiles="https://github.com/stedolan/jq/releases/download/jq-${version}/jq-${version}.tar.gz"
|
||||
checksum=c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c
|
||||
checksum=70e822e3e7542736424d0afb33584f568b5e3a9bc4cdb16c14da678640b20756
|
||||
|
||||
pre_configure() {
|
||||
autoreconf -fi
|
||||
echo "echo $version" >scripts/version
|
||||
}
|
||||
|
||||
post_install() {
|
||||
rm -rf ${DESTDIR}/usr/share/doc/$pkgname
|
||||
|
|
Loading…
Reference in a new issue