diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-11-01 20:48:33 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-11-01 20:48:33 +0100 |
commit | 849d39783113dab5f3130e3e59cd8b30f53b136e (patch) | |
tree | 48df1e0829fb7f0551329af9b236cb3250b01a65 /src/main.c | |
parent | ec5976bbd5a930e040a34b9e93bf9cc41d7230c1 (diff) |
Print the compile error offset
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -343,8 +343,10 @@ pattern_comp(u8view_t pat) int ec; size_t eoff; op.re = pcre2_compile(re.p, re.len, reopts, &ec, &eoff, nullptr); - if (op.re == nullptr) - pcre2_bitch_and_die(ec, "failed to compile regex: %s"); + if (op.re == nullptr) { + pcre2_bitch_and_die( + ec, "failed to compile regex at byte offset %zu: %s", eoff); + } if ((ec = pcre2_jit_compile(op.re, PCRE2_JIT_COMPLETE)) != 0) { pcre2_bitch_and_die(ec, "failed to JIT compile regex: %s"); rv = EXIT_WARNING; |