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

join/1 should respect empty strings in input #668

Closed
nicowilliams opened this issue Jan 14, 2015 · 2 comments
Closed

join/1 should respect empty strings in input #668

nicowilliams opened this issue Jan 14, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@nicowilliams
Copy link
Contributor

The join/1 builtin needs help:

-def join($x): reduce .[] as $i (""; . + (if . == "" then $i else $x + $i end));
+def join($x): reduce .[] as $i (null; (.//"") + (if . == null then $i else $x + $i end));

See also comments on #552.

@nicowilliams nicowilliams self-assigned this Jan 14, 2015
@nicowilliams nicowilliams added this to the 1.5 release milestone Jan 14, 2015
joelpurra added a commit to joelpurra/jq that referenced this issue Jan 14, 2015
@joelpurra
Copy link
Contributor

@nicowilliams: join fails for an empty input array; see pull request #669.

nicowilliams added a commit that referenced this issue Jan 14, 2015
Empty arrays join/1 to an empty string, fixes #668 bug introduced by 9760245
@joelpurra
Copy link
Contributor

This issue was fixed by #669 cca3e92. Thanks!

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

2 participants