]> git.kaiwu.me - njs.git/commitdiff
Fixed exception throwing when RegExp match fails.
authorDmitry Volyntsev <xeioex@nginx.com>
Mon, 22 Nov 2021 13:37:11 +0000 (13:37 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Mon, 22 Nov 2021 13:37:11 +0000 (13:37 +0000)
The issue was introduced in a83775113025 (0.1.15).

This closes #439 issue on Github.

src/njs_regexp.c

index 684417301c0a0fe920f122cf5550bf3bdb2276b9..f851045f332b9d074645f1c7b6b20e553507d966 100644 (file)
@@ -446,7 +446,7 @@ njs_regexp_match_trace_handler(njs_trace_t *trace, njs_trace_data_t *td,
     trace = trace->next;
     p = trace->handler(trace, td, start);
 
-    njs_internal_error(vm, (const char *) start);
+    njs_internal_error(vm, "%*s", p - start, start);
 
     return p;
 }