Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure with --slurp enabled #18

Closed
vaughan0 opened this issue Oct 22, 2012 · 1 comment
Closed

Assertion failure with --slurp enabled #18

vaughan0 opened this issue Oct 22, 2012 · 1 comment
Labels

Comments

@vaughan0
Copy link

I accidentally discovered an assertion failure when running jq with the following input:

$ echo -e '{ "foo": 42\n}' | jq --slurp .
jq: jv.c:280: jv_array_length: Assertion `jv_get_kind(j) == JV_KIND_ARRAY' failed.
Aborted
@stedolan
Copy link
Contributor

This was a silly bug in the 'slurp' logic, which was roughly "create a new array if it's the first thing, append to the existing array if it's any later thing".

"thing" should mean "JSON value", but it was implemented as "line of input text".

@dtolnay dtolnay added the bug label Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants