summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-11-12Incorporate lutzmader's patchesbugfix/aix-issues-jq1.6William Langford
2018-11-12Some syntax tweaks for AIXWilliam Langford
2018-11-12Define JV_*PRINTF_LIKE for non-__GNUC__ compilersWilliam Langford
2018-11-02Minor website fixes for 1.6William Langford
2018-11-01Release jq-1.6jq-1.6William Langford
2018-11-01Update website with details for jq-1.6William Langford
2018-10-21Fix website whitespaceWilliam Langford
2018-10-21Add documentation for destructuring alternationWilliam Langford
2018-10-12Bugfix: Math function checkingAlex Ozdemir
We had config machinery that determined which math functions are available in libc. If a c math function was missing on the host system, then the corresponding jq function would be removed from the source, enabling the build to proceed anyway. The detection machinery was broken in a subtle way, as was shown after glibc updated to 2.27, dropping the `pow10` function. This caused compilation to fail. The essential problem was that we detected whether a math function was available by compiling and linking a small program evaluating that function on constants. However, since gcc's optimization machinery has special knowledge of some math functions (e.g. `pow10`), it can optimize them away, even if they don't exist in the library and are not linkable. That is, the following example compiles and links against glibc 2.27, even though `pow10` has been removed: ``` int main () { printf("%f", pow10(0.5)); return 0; } ``` What?! On the other hand, this program does not link: ``` int main () { double f; printf("%f", &f); printf("%f", pow10(f)); return 0; } ``` In the first program the call to `pow10` can be optimized away as a constant expression. This requires GCC to know about `pow10` (which it does!), but it does not require `pow10` to be in the library (and actually linkable). The solution is to use autoconf's machinery for detecting function presence, instead of our own (buggy) machinery. This has the added benefit of simplifying the code. The bug was reported in issue #1659
2018-08-30Fix osx travis buildWilliam Langford
2018-08-30fix memory leakWilliam Langford
2018-08-17Restore JV_PRINT_COLOUR as an alias1.6rc2William Langford
JV_PRINT_COLOUR was part of the public libjq headers and was removed as part of 2d05b54. While JV_PRINT_COLOR is definitely the preferred spelling this side of the pond, we shouldn't just remove otherwise exposed enum values.
2018-08-17Fix destructuring alternationfix-destructuring-alternationWilliam Langford
Attempting to use the existing FORK_OPT opcode resulted in difficulty knowing when to pop an error message off the stack and when not to. This commit makes DESTRUCTURE_ALT a real opcode that is identical to FORK_OPT, except for never pushing the error message onto the stack when continuing from an error backtrack. Some small changes were necessary to the DUP/POP behavior surrounding destructuring to accomodate this.
2018-08-17Create issue templateWilliam Langford
2018-05-11jv_file.c: check to see if the file is a directory and failRoland C. Dowdeswell
Not all stdio implementations disallow one to open a directory with fopen(3) and so we specifically check for directories as it is also in the standard search path.
2018-03-06Make limit/2 more efficientNicolas Williams
Contributed by @pkoppstein.
2018-03-06limit/2 evals exp one time too manyNicolas Williams
2018-03-01src/main.c: fix issue #1587 by using jv_dumpf in the raw-output and ↵rain1
ascii-output case. retain fwrite in the raw-output case.
2018-02-23Fix "provides" typoRiley Avron
2018-02-20Change backticks to the more legible $()David Fetter
2018-02-20Build static binaries and deploy to GH Releases from TravisJakub Jirutka
2018-02-20Build and run tests against musl libc using Alpine Linux on TravisJakub Jirutka
2018-02-20Change Travis config to utilize Build StagesJakub Jirutka
See: https://docs.travis-ci.com/user/build-stages/
2018-01-04fix FreeBSD install instructionsPaul Chvostek
2017-12-12Updated the compile-ios.sh script to fix issues with local oniguruma path.Larry Aasen
2017-12-11Update AUTHORSjq-1.6rc1Nicolas Williams
2017-12-11Added rawfileDavid Fetter
In passing, clean remnants of argfile from slurpfile docs.
2017-12-11Revert "reduce: handle empty updates (fix #1313)"Nicolas Williams
This reverts commit e24af3c78e78a3aab05a2800d825d56f1d842b1b. While the semantics are desirable, there is no way to implement them efficiently. The reason is that in order to handle backtracking (empty) from the state update expression, we have to retain a reference to the reduction state value in order to restore it upon backtracking. Retaining a reference to the reduction state kills performance by causing lots of additional memory allocations and garbage because the input to the update expression will always have at least two references, thus no changes to it can be done in-place, and all changes end up being CoW changes. Avoiding this is the very reason for the LOADVN instruction (leaving `null` in the variable loaded from).
2017-12-10Fix import as $data linkingNicolas Williams
2017-12-04Fix hang for slurped inputs with trailing newlineWilliam Langford
2017-12-04Fix #1534William Langford
2017-11-29Actually fix the strptime testsmacos-strptimeWilliam Langford
This has been a complicated issue to fix for a number of reasons. The core of it is that the behavior is different between different versions of macOS, some of which set possible-but-incorrect values. This commit addresses the issue by always using our computation for tm_wday and tm_yday on macOS. As a side-effect, strptime format strings that specify %u and %j will no longer work on macOS.
2017-11-29Keep object keys in parsing order in `tostream` outputEric Bréchemier
As noted by @nicowilliams, `tostream` used `keys`, which sorts the keys in alphabetical order, instead of `keys_unsorted`, which preserves the parsing order. Fixes #1541.
2017-11-28Use rvm to install ruby 1.9.3Andrew Speed
2017-11-27Fix strptime tests on macOS 10.12William Langford
Dates in 1900 are before the Unix epoch. We shouldn't make any promises about how well they are supported, especially given that our time support is a thin wrapper over the libc functions. This changes the test to use dates after the epoch, which should fit within both a signed and an unsigned 32-bit time_t.
2017-11-27Fix memory leaks in various c-coded builtinsWilliam Langford
2017-11-23Fix leak on error in strptimeNicolas Williams
2017-11-22Typo correctiontrantor
Suppresion -> Suppression
2017-06-19Merge pull request #1403 from Argoday/masterWilliam Langford
Use unsorted keys in walk
2017-05-21Deal with strptime() on OS X and *BSD (fix #1415)Nicolas Williams
strptime() on OS X and *BSDs (reputedly) does not set tm_wday and tm_yday unless corresponding %U and %j format specifiers were used. That can be... surprising when one parsed year, month, and day anyways. Glibc's strptime() conveniently sets tm_wday and tm_yday in those cases, but OS X's does not, ignoring them completely. This commit makes jq compute those where possible, though the day of week computation may be wrong for dates before 1900-03-01 or after 2099-12-31.
2017-05-21Attempt to fix #1415Nicolas Williams
OS X (and *BSD) strptime() does not set tm_wday nor tm_yday unless corresponding format options are used. That means we must call timegm() to set them.
2017-05-21Add private my_timegm()Nicolas Williams
2017-05-21Fix HAVE_TM_TM_GMT_OFF usageNicolas Williams
2017-05-21Use AC_CHECK_MATH_FUNC() for all math functionsNicolas Williams
2017-05-20Fix jv_load_file() assertion (fix #1410)Nicolas Williams
2017-05-11Improved git build instructions.Daniel Lange
2017-05-03Use unsorted keys in walkJonathan Word
Preserve key sorting order when executing in walk, if sorted keys is desired `--sort-keys` should be used to explicitly obtain sorted keys.
2017-04-29Add JQ_COLORS env var for color config (fix #1252)Nico Williams
2017-04-26Fix buildNicolas Williams
2017-04-21Always use jv_mem_*alloc()Nicolas Williams