summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--COPYING10
-rw-r--r--README.md11
-rw-r--r--src/decNumber/decBasic.c2
-rw-r--r--src/decNumber/decNumber.c8
-rw-r--r--src/jv_print.c4
-rw-r--r--src/util.c6
-rw-r--r--src/util.h2
7 files changed, 31 insertions, 12 deletions
diff --git a/COPYING b/COPYING
index c162125a..cae6975a 100644
--- a/COPYING
+++ b/COPYING
@@ -106,6 +106,15 @@ shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
+--------------------------------------------------------------------------------
+All trademarks and registered trademarks mentioned herein are the property of their respective owners.
+
+
+
+jv_thread.h is copied from Heimdal's lib/base/heimbase.h and some code
+in jv.c is copied from Heimdal's lib/base/dll.c:
+
+
Portions Copyright (c) 2016 Kungliga Tekniska Högskolan
(Royal Institute of Technology, Stockholm, Sweden).
All rights reserved.
@@ -133,4 +142,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/README.md b/README.md
index 1d06b0cf..ea4ea2e4 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,17 @@ Download the latest releases from the [GitHub release page](https://github.com/j
Pull the [jq image](https://github.com/jqlang/jq/pkgs/container/jq) to start quickly with Docker.
+
+#### Run with Docker
+##### Example: Extracting the version from a `package.json` file
+```bash
+docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version'
+```
+##### Example: Extracting the version from a `package.json` file with a mounted volume
+```bash
+docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json
+```
+
### Building from source
#### Dependencies
diff --git a/src/decNumber/decBasic.c b/src/decNumber/decBasic.c
index 1f680c4a..a0ec4552 100644
--- a/src/decNumber/decBasic.c
+++ b/src/decNumber/decBasic.c
@@ -756,7 +756,7 @@ static void decFiniteMultiply(bcdnum *num, uByte *bcdacc,
#endif
/* Effect the multiplication */
- // The multiplcation proceeds using MFC's lazy-carry resolution
+ // The multiplication proceeds using MFC's lazy-carry resolution
// algorithm from decNumber. First, the multiplication is
// effected, allowing accumulation of the partial products (which
// are in base-billion at each column position) into 64 bits
diff --git a/src/decNumber/decNumber.c b/src/decNumber/decNumber.c
index 5062634d..a10fd411 100644
--- a/src/decNumber/decNumber.c
+++ b/src/decNumber/decNumber.c
@@ -2168,7 +2168,7 @@ decNumber * decNumberPower(decNumber *res, const decNumber *lhs,
// if a negative power the constant 1 is needed, and if not subset
// invert the lhs now rather than inverting the result later
if (decNumberIsNegative(rhs)) { // was a **-n [hence digits>0]
- decNumber *inv=invbuff; // asssume use fixed buffer
+ decNumber *inv=invbuff; // assume use fixed buffer
decNumberCopy(&dnOne, dac); // dnOne=1; [needed now or later]
#if DECSUBSET
if (set->extended) { // need to calculate 1/lhs
@@ -3798,7 +3798,7 @@ static void decToString(const decNumber *dn, char *string, Flag eng) {
/* */
/* Addition, especially x=x+1, is speed-critical. */
/* The static buffer is larger than might be expected to allow for */
-/* calls from higher-level funtions (notable exp). */
+/* calls from higher-level functions (notable exp). */
/* ------------------------------------------------------------------ */
static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
const decNumber *rhs, decContext *set,
@@ -4212,7 +4212,7 @@ static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
/* long subtractions. These are acc and var1 respectively. */
/* var1 is a copy of the lhs coefficient, var2 is the rhs coefficient.*/
/* The static buffers may be larger than might be expected to allow */
-/* for calls from higher-level funtions (notable exp). */
+/* for calls from higher-level functions (notable exp). */
/* ------------------------------------------------------------------ */
static decNumber * decDivideOp(decNumber *res,
const decNumber *lhs, const decNumber *rhs,
@@ -5203,7 +5203,7 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs,
/* exp(-x) where x can be the tiniest number (Ntiny). */
/* */
/* 2. Normalizing x to be <=0.1 (instead of <=1) reduces loop */
-/* iterations by appoximately a third with additional (although */
+/* iterations by approximately a third with additional (although */
/* diminishing) returns as the range is reduced to even smaller */
/* fractions. However, h (the power of 10 used to correct the */
/* result at the end, see below) must be kept <=8 as otherwise */
diff --git a/src/jv_print.c b/src/jv_print.c
index 390b38c9..ffe15234 100644
--- a/src/jv_print.c
+++ b/src/jv_print.c
@@ -206,7 +206,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
if (jv_get_kind(msg) == JV_KIND_STRING) {
put_str("<invalid:", F, S, flags & JV_PRINT_ISATTY);
jvp_dump_string(msg, flags | JV_PRINT_ASCII, F, S, flags & JV_PRINT_ISATTY);
- put_str(">", F, S, flags & JV_PRINT_ISATTY);
+ put_char('>', F, S, flags & JV_PRINT_ISATTY);
} else {
put_str("<invalid>", F, S, flags & JV_PRINT_ISATTY);
}
@@ -259,7 +259,7 @@ static void jv_dump_term(struct dtoa_context* C, jv x, int flags, int indent, FI
put_str("[]", F, S, flags & JV_PRINT_ISATTY);
break;
}
- put_str("[", F, S, flags & JV_PRINT_ISATTY);
+ put_char('[', F, S, flags & JV_PRINT_ISATTY);
jv_array_foreach(x, i, elem) {
if (i!=0) {
if (color) put_str(color, F, S, flags & JV_PRINT_ISATTY);
diff --git a/src/util.c b/src/util.c
index 4a5ba98c..cfe65c4a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -107,12 +107,12 @@ jv get_home() {
#else
home = getenv("USERPROFILE");
if (!home) {
- char *hd = getenv("HOMEDRIVE");
- if (!hd) hd = "";
home = getenv("HOMEPATH");
if (!home) {
ret = jv_invalid_with_msg(jv_string("Could not find home directory."));
} else {
+ const char *hd = getenv("HOMEDRIVE");
+ if (!hd) hd = "";
ret = jv_string_fmt("%s%s",hd,home);
}
} else {
@@ -708,7 +708,7 @@ recurse:
continue;
case 'x': /* The date, using the locale's format. */
- /* fall throug */
+ /* fall through */
case 'D': /* The date as "%y/%m/%d". */
{
diff --git a/src/util.h b/src/util.h
index 562ac19a..6fdef383 100644
--- a/src/util.h
+++ b/src/util.h
@@ -59,7 +59,7 @@ const void *_jq_memmem(const void *haystack, size_t haystacklen,
#include <time.h>
-#if defined(WIN32) && !defined(HAVE_STRPTIME)
+#ifndef HAVE_STRPTIME
char* strptime(const char *buf, const char *fmt, struct tm *tm);
#endif