summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-02-22fixup! Configure appveyor build to use pythonno-more-rubyWilliam Langford
2019-02-22fixup! Configure appveyor build to use pythonWilliam Langford
2019-02-22fixup! Configure appveyor build to use pythonWilliam Langford
2019-02-22Change contains to return true for empty string needlesWilliam Langford
The behavior of memmem for an empty needle is inconsistent between implementations of libc. Our tests imply that we want an empty string needle to be true, so check for an empty needle before calling memmem.
2019-02-22Configure appveyor build to use pythonWilliam Langford
2019-02-22Cleanup leftover references to rubyWilliam Langford
2019-02-22Configure travis build to use pythonWilliam Langford
2019-02-22Remove ruby dependency from mantestsWilliam Langford
2019-02-22Remove ruby dependency from manpage buildWilliam Langford
2019-02-22Remove ruby dependency from website buildWilliam Langford
2019-02-21Merge pull request #1837 from muhmuhten/limit_0Nico Williams
2019-02-21Ensure limit(0; ...) is emptyMuh Muhten
2019-02-20Rewrite `_assign/2` using `$argument` syntaxMuh Muhten
2019-02-20Work around fgets()'s lack of length reportingMuh Muhten
Stop losing \0s from the end of files because we don't know how much fgets() read into our buffer. If we prefill the buffer with anything other than zeroes, we can actually tell the difference between the terminator and unused space in the buffer. This is possibly more expensive, but at least it should be correct. Fixes #1504
2019-02-20Fix if-then-else example formattingNicolas Williams
2019-02-20Document optional `else` clause of `if`Nicolas Williams
2019-02-20Support "if" without "else" clauseChance Zibolski
Defaults the else clause to the identity filter "." if an else clause is missing. The following two jq programs are considered equivalent: ``` if .foo then .foo = "bar" else . end ``` ``` if .foo then .foo = "bar" end ```
2019-02-20Bind data imports properly when already resolvedMuh Muhten
2019-02-20Make builtin binding fast again by binding only referenced symbolsMuh Muhten
Avoid doing the internal binding of top-level symbols in the parser, leaving that work to be done in a post-processing step. For builtins, this lets us do a reference-aware bind step (block_bind_incremental) *after* generating builtins/0. Libraries are a bit trickier since they may be bound multiple times, so instead of thinking through the implications I added (block_bind_self) to resolve all internal symbols immediately.
2019-02-20Load ~/.jq as a library instead of with builtinsMuh Muhten
Remove the special code which loads ~/.jq in builtin.c, and instead glue an optional include which points to the same file onto the main program in linker.c. Fixes a minor bug where errors in ~/.jq would be labelled <builtin>.
2019-02-20Add import metadata key "optional"Muh Muhten
A library marked is imported if found, but silently skipped if missing. This is the desired semantic for the auto-include at ~/.jq
2019-02-20Replace TOP-before-imports special case with assertMuh Muhten
The case isn't actually possible afaict.
2019-02-20Catch .. as the first component of a module pathMuh Muhten
Only the second and subsequent path components were being checked, which I guess is theoretically security-relevant. There's no apparent point to reconstructing the path after splitting it by adding /s back in, either.
2019-02-20Pass on the error message when rel_path is invalidMuh Muhten
"Module path must be a string" is not a useful error message when the reason the module path isn't a string is because the string it was got replaced with an invalid with an error message for some other reason. Also fixes a few memory leaks on early exits.
2019-02-20Simplify definition of block_bind_referencedMuh Muhten
2019-02-17Allow globbing on WindowsJason Hood
The mingw-w64 runtime expands wildcards, which causes a discrepancy between `main`'s `argv` (multiple file names) and Windows' `wargv` (a single wildcard). Use `wmain` to retrieve the wide character args.
2019-02-16Make UTC time on WindowsJason Hood
Windows has `_mkgmtime` for the UTC equivalent of `mktime`.
2019-02-16Add ISO 8601-specific strptimeJason Hood
Implement `strptime` for systems lacking it, but only supporting the ISO 8601 format string.
2019-02-16Prevent redirecting to NUL crashJason Hood
Windows regards the `NUL` device as tty, which causes `WriteFile` to fail (the bytes written pointer cannot be `NULL` in this case). Tweak the color test to ensure tty is accurate.
2019-02-16Possibly enable color output on Windows (#1494)Jason Hood
Windows 10 supports color output, but it must be explicitly enabled; ANSICON provides support for other versions. Enable color if either of those are available. Resolves #1494.
2019-02-16Reimplement block_drop_unreferenced in linear timeMuh Muhten
2019-02-09Merge pull request #1818 from muhmuhten/free_in_indexNico Williams
2019-02-09Make sure to free in jv_string_indexesMuh Muhten
2019-02-08Improve linking time by marking subtrees with unbound symbolsMuh Muhten
2019-02-08Fix infinite loop in index("") (fix #1815)Nicolas Williams
2019-02-07FIX if-then-else exampleMatt Clegg
"(.+)" doesn't match new line characters so the link generated for [if-then-else](https://github.com/stedolan/jq/blob/90bc29c1b544c0436ec44246e180fdbb6d6384df/docs/content/3.manual/v1.5/manual.yml#L1804) doesn't work
2019-02-07Define error/1 in terms of error/0Muh Muhten
The parser generates a call to error/0 on break. Having that exported from C directly removes a language dependency on builtin.jq. In any case, error/0 seems to be the more fundamental operation, seeing as the old C impementation of error/1 did nothing useful with its input.
2019-02-06Export input/0 directly from C, removing _input/0Muh Muhten
The distinction between input/0 and _input/0 has been unnecessary since a9c613..7dc34b, which moved end-of-input handling into C and replaced the jq definition of input with `def input: _input;`
2019-02-04builtin/f_match: prevent overruns of input_stringDerrick Pallas
If these values do not match exactly, it is because the UTF-8 is invalid anyway and we counted codepoints differently than oniguruma did. Perhaps it would be better to error out here, but at least one similar loop already uses < vs != and since we're off the rails anyway this might be OK. It is certainly better than overruning the buffer. Resolves https://github.com/stedolan/jq/issues/1804
2019-02-02builtin/f_match: call onig_error_code_to_str with einfo correctlyDerrick Pallas
2019-01-30Unify timegm fallbacks into my_mktimeMuh Muhten
my_timegm was introduced in 1900c7 to add a mktime fallback used in 4a6241, the subsequently removed in c53823. As a result of this code shuffling, the jq mktime function (f_mktime) wound up using a fallback even on systems where timegm is available, with incorrect results in some time zones with DST, e.g. % TZ=America/New_York jq -n '"2018-08-31T00:00:00Z"|fromdate|todate' "2018-08-31T01:00:00Z" This undoes 1900c7 and moves the workaround it added into the #else of my_mktime.
2019-01-30Fix build on BSD makeMuh Muhten
Replace uses of the nonstandard $^ variable by explicitly specifying the source filenames. This is the only obvious thing preventing the build from running correctly on non-GNU make.
2019-01-30Fix include/import namespace confusionMuh Muhten
2019-01-22Add tests for built-in function `contains`David Haguenauer
2019-01-18`contains` should handle embedded NULs (fix #1732)Nicolas Williams
2019-01-05Merge pull request #1774 from dooglus/patch-1William Langford
Fix grammar typo.
2018-12-26Out-of-srcdir builds: AM_CPPFLAGS=-I${srcdir}/srcNicolas Williams
2018-12-26builtin: add missing windows.h includeRicardo Constantino
Follow-up fix to b436156f5 because BOOL and DWORD are not built-in to mingw64.
2018-12-26Makefile.am: add no-undefined for win32Ricardo Constantino
"Undefined symbols are not allowed in x86_64-w64-mingw32 shared libraries" This was also applied in the official MINGW-packages repo: Alexpux/MINGW-packages@b5566c58a
2018-12-19Mingw-w64 on windows doesn't have `setenv`, fix that.HE, Tao
Signed-off-by: HE, Tao <sighingnow@gmail.com>