|
| 1 | +--- configure.ac |
| 2 | ++++ configure.ac |
| 3 | +@@ -270,10 +270,10 @@ AS_IF([test "x$with_oniguruma" != xno], [ |
| 4 | + # check for ONIGURUMA library, either in /usr or where requested |
| 5 | + CFLAGS="$CFLAGS $onig_CFLAGS" |
| 6 | + LDFLAGS="$LDFLAGS $onig_LDFLAGS" |
| 7 | +- AC_CHECK_HEADER("oniguruma.h", |
| 8 | +- AC_CHECK_LIB([onig],[onig_version])) |
| 9 | ++ AC_CHECK_HEADER("onigmo.h", |
| 10 | ++ AC_CHECK_LIB([onigmo],[onig_version])) |
| 11 | + # handle check results |
| 12 | +- AS_IF([test "x$ac_cv_lib_onig_onig_version" != "xyes"], [ |
| 13 | ++ AS_IF([test "x$ac_cv_lib_onigmo_onig_version" != "xyes"], [ |
| 14 | + build_oniguruma=yes |
| 15 | + AC_MSG_NOTICE([Oniguruma was not found. Will use the packaged oniguruma.]) |
| 16 | + ]) |
| 17 | +--- src/builtin.c |
| 18 | ++++ src/builtin.c |
| 19 | +@@ -29,8 +29,8 @@ void *alloca (size_t); |
| 20 | + #include <ctype.h> |
| 21 | + #include <limits.h> |
| 22 | + #include <math.h> |
| 23 | +-#ifdef HAVE_LIBONIG |
| 24 | +-#include <oniguruma.h> |
| 25 | ++#ifdef HAVE_LIBONIGMO |
| 26 | ++#include <onigmo.h> |
| 27 | + #endif |
| 28 | + #include <string.h> |
| 29 | + #include <time.h> |
| 30 | +@@ -801,7 +801,7 @@ static jv f_group_by_impl(jq_state *jq, jv input, jv keys) { |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | +-#ifdef HAVE_LIBONIG |
| 35 | ++#ifdef HAVE_LIBONIGMO |
| 36 | + static int f_match_name_iter(const UChar* name, const UChar *name_end, int ngroups, |
| 37 | + int *groups, regex_t *reg, void *arg) { |
| 38 | + jv captures = *(jv*)arg; |
| 39 | +@@ -889,7 +889,7 @@ static jv f_match(jq_state *jq, jv input, jv regex, jv modifiers, jv testmode) { |
| 40 | + |
| 41 | + onigret = onig_new(®, (const UChar*)jv_string_value(regex), |
| 42 | + (const UChar*)(jv_string_value(regex) + jv_string_length_bytes(jv_copy(regex))), |
| 43 | +- options, ONIG_ENCODING_UTF8, ONIG_SYNTAX_PERL_NG, &einfo); |
| 44 | ++ options, ONIG_ENCODING_UTF8, ONIG_SYNTAX_PERL58_NG, &einfo); |
| 45 | + if (onigret != ONIG_NORMAL) { |
| 46 | + UChar ebuf[ONIG_MAX_ERROR_MESSAGE_LEN]; |
| 47 | + onig_error_code_to_str(ebuf, onigret, &einfo); |
| 48 | +@@ -1005,11 +1005,11 @@ static jv f_match(jq_state *jq, jv input, jv regex, jv modifiers, jv testmode) { |
| 49 | + jv_free(regex); |
| 50 | + return result; |
| 51 | + } |
| 52 | +-#else /* !HAVE_LIBONIG */ |
| 53 | ++#else /* !HAVE_LIBONIGMO */ |
| 54 | + static jv f_match(jq_state *jq, jv input, jv regex, jv modifiers, jv testmode) { |
| 55 | +- return jv_invalid_with_msg(jv_string("jq was compiled without ONIGURUMA regex library. match/test/sub and related functions are not available.")); |
| 56 | ++ return jv_invalid_with_msg(jv_string("jq was compiled without ONIGMO regex library. match/test/sub and related functions are not available.")); |
| 57 | + } |
| 58 | +-#endif /* HAVE_LIBONIG */ |
| 59 | ++#endif /* HAVE_LIBONIGMO */ |
| 60 | + |
| 61 | + static jv minmax_by(jv values, jv keys, int is_min) { |
| 62 | + if (jv_get_kind(values) != JV_KIND_ARRAY) |
0 commit comments